-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
63 lines (63 loc) · 3.34 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<Window x:Class="QuickTasks.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:QuickTasks"
mc:Ignorable="d"
Name="Main"
Title="QuickTasks" Height="450" SizeChanged="Window_SizeChanged"
Style="{StaticResource WindowStyle}">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
</Window.Resources>
<StackPanel>
<Label />
<Grid Margin="0">
<local:TitleBar x:Name="ucTitleBar" HorizontalAlignment="Stretch"
Title="{Binding Path=TitleText}"
Rename="{Binding Path=TitleRename}"
Save="{Binding Path=SaveToDisk}"
Reload="{Binding Path=ReloadFromDisk}"
Add="{Binding Path=AddItem}"
Redo="{Binding Path=Redo}"
Undo="{Binding Path=Undo}"
Quit="{Binding Path=Quit}" />
</Grid>
<DockPanel Margin="10" Visibility="{Binding ElementName=MainTaskList, Path=ItemsSource.IsEmpty, Converter={StaticResource BoolToVis}}"
AllowDrop="True" Drop="LVI_Drop" >
<TextBlock x:Name="EmptyListBanner" TextAlignment="Center" TextWrapping="Wrap" >
There is nothing here. <LineBreak/>
Use "+" or drag and drop<LineBreak />
to add new tasks...
</TextBlock>
</DockPanel>
<StackPanel Name="ListContainer" Margin="0" >
<ListView ItemsSource="{Binding tasks}" Name="MainTaskList" Padding="0" Margin="0" Background="{StaticResource bgColor}"
BorderBrush="{x:Null}" >
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Padding" Value="0 3" />
<Setter Property="Margin" Value="0" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<local:LVI
LVItem="{Binding}"
Launch="{Binding DataContext.LaunchAndQuit, RelativeSource={RelativeSource AncestorType=ListView}}"
Rename="{Binding DataContext.Rename, RelativeSource={RelativeSource AncestorType=ListView}}"
Delete="{Binding DataContext.RemoveItem, RelativeSource={RelativeSource AncestorType=ListView}}"
Padding="0"
MouseMove="LVI_Drag"
AllowDrop="True"
Drop="LVI_Drop"
/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
<local:InfoBox x:Name="ucInfo" Message="" LogLevel="" AllowDrop="True" Drop="LVI_Drop" />
</StackPanel>
</Window>