TasksByStatusControl.xaml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <UserControl x:Class="PRSDesktop.TasksByStatusControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PRSDesktop"
  7. mc:Ignorable="d"
  8. x:Name="Control"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <ResourceDictionary>
  12. <ResourceDictionary.MergedDictionaries>
  13. <ResourceDictionary Source="KanbanResources.xaml"/>
  14. </ResourceDictionary.MergedDictionaries>
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <UserControl.CommandBindings>
  18. <CommandBinding Command="{x:Static local:KanbanResources.EditTask}"
  19. Executed="EditTask_Executed"
  20. CanExecute="CommandBinding_CanExecute"/>
  21. <CommandBinding Command="{x:Static local:KanbanResources.OpenTaskMenu}"
  22. Executed="OpenTaskMenu_Executed"
  23. CanExecute="CommandBinding_CanExecute"/>
  24. <CommandBinding Command="{x:Static local:KanbanResources.SelectTask}"
  25. Executed="SelectTask_Executed"
  26. CanExecute="CommandBinding_CanExecute"/>
  27. </UserControl.CommandBindings>
  28. <Grid x:Name="LayoutRoot">
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="Auto" x:Name="EmployeeListColumn" />
  31. <ColumnDefinition Width="*" />
  32. </Grid.ColumnDefinitions>
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="Auto" />
  35. <RowDefinition Height="*" />
  36. </Grid.RowDefinitions>
  37. <Border Grid.Row="0" Grid.Column="0" CornerRadius="5,5,0,0" BorderBrush="Gray" BorderThickness="0.75"
  38. Background="WhiteSmoke" Padding="5" Margin="0,0,4,2">
  39. <Label Content="Employee List" HorizontalContentAlignment="Center" />
  40. </Border>
  41. <ListView Grid.Column="0" Grid.Row="1" x:Name="EmployeeList" HorizontalAlignment="Stretch"
  42. SelectionChanged="Employees_SelectionChanged" Margin="0,0,4,0" Background="White" BorderBrush="Gray"
  43. BorderThickness="0.75">
  44. <ListView.ItemTemplate>
  45. <DataTemplate>
  46. <Grid HorizontalAlignment="Stretch" Margin="4,2,4,2">
  47. <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
  48. <Border Width="40" Height="40" CornerRadius="20" BorderBrush="Black" BorderThickness="1"
  49. VerticalAlignment="Center" HorizontalAlignment="Center">
  50. <Border.Background>
  51. <ImageBrush ImageSource="{Binding Path=Image}" Stretch="UniformToFill" />
  52. </Border.Background>
  53. </Border>
  54. <TextBlock x:Name="PCName" Height="Auto" TextWrapping="Wrap" Width="80" Margin="4,0,0,0"
  55. TextAlignment="Left" Text="{Binding Name}" VerticalAlignment="Center" />
  56. </StackPanel>
  57. </Grid>
  58. </DataTemplate>
  59. </ListView.ItemTemplate>
  60. </ListView>
  61. <Border Grid.Row="0" Grid.Column="1" CornerRadius="5,5,0,0" BorderBrush="Gray" BorderThickness="0.75"
  62. Background="WhiteSmoke" Padding="5" Margin="0,0,0,2">
  63. <DockPanel>
  64. <Button DockPanel.Dock="Left" x:Name="TaskTypesLabel" Content="Filter" Padding="4,0" Click="TaskTypesLabel_OnClick" />
  65. <ComboBox DockPanel.Dock="Left" x:Name="TaskTypes" Margin="5,0,0,0" Width="150" SelectedIndex="0"
  66. SelectionChanged="TaskTypes_SelectionChanged" VerticalContentAlignment="Center"
  67. SelectedValuePath="Key" DisplayMemberPath="Value" />
  68. <Button DockPanel.Dock="Left" x:Name="JobFilterBtn" Content="Filter Job" Padding="4,0" Margin="5,0,0,0" Click="JobFilterBtn_OnClick" />
  69. <local:TaskPanelFilterButton DockPanel.Dock="Left" x:Name="FilterButton"
  70. Margin="5,0,0,0"
  71. OnFilterRefresh="FilterButton_OnFilterRefresh"
  72. OnFiltersSelected="FilterButton_OnFiltersSelected"/>
  73. <Label DockPanel.Dock="Left" Content="Search" Margin="5,0,0,0" />
  74. <Button DockPanel.Dock="Right" x:Name="Export" Padding="10,0" Margin="5,0,0,0" Content="Export"
  75. Click="Export_Click" />
  76. <CheckBox DockPanel.Dock="Right" x:Name="IncludeCompleted" Margin="10,0,5,0"
  77. Content="Include Completed" VerticalAlignment="Center" HorizontalAlignment="Right"
  78. Checked="IncludeCompleted_Checked" Unchecked="IncludeCompleted_Checked" />
  79. <CheckBox DockPanel.Dock="Right" x:Name="IncludeObserved" Margin="10,0,5,0" Content="Include Observing"
  80. VerticalAlignment="Center" HorizontalAlignment="Right" Checked="IncludeObserved_Checked"
  81. Unchecked="IncludeObserved_Checked" />
  82. <CheckBox DockPanel.Dock="Right" x:Name="IncludeLocked" Margin="10,0,5,0" Content="Include Locked"
  83. VerticalAlignment="Center" HorizontalAlignment="Right" Checked="IncludeLocked_Checked"
  84. Unchecked="IncludeLocked_Checked" />
  85. <ComboBox DockPanel.Dock="Right" x:Name="ViewType" Margin="5,0,0,0" Width="100" SelectedIndex="0"
  86. SelectionChanged="ViewType_SelectionChanged" VerticalContentAlignment="Center">
  87. <ComboBoxItem Content="Full" />
  88. <ComboBoxItem Content="Compact" />
  89. </ComboBox>
  90. <Label DockPanel.Dock="Right" x:Name="ViewTypeLabel" Content="View" Margin="5,0,0,0" />
  91. <TextBox DockPanel.Dock="Left" x:Name="Search" Margin="5,0,0,0" HorizontalAlignment="Stretch"
  92. VerticalContentAlignment="Center" KeyUp="Search_KeyUp" />
  93. </DockPanel>
  94. </Border>
  95. <ItemsControl x:Name="ColumnsList" ItemsSource="{Binding ElementName=Control,Path=Columns}"
  96. Grid.Row="1" Grid.Column="1">
  97. <ItemsControl.ItemsPanel>
  98. <ItemsPanelTemplate>
  99. <UniformGrid Rows="1"/>
  100. </ItemsPanelTemplate>
  101. </ItemsControl.ItemsPanel>
  102. <ItemsControl.ItemTemplate>
  103. <DataTemplate>
  104. <Border BorderBrush="LightGray" BorderThickness="0.75,0,0,0">
  105. <Grid ContextMenuOpening="Column_ContextMenuOpening"
  106. Tag="{Binding}">
  107. <Grid.ContextMenu>
  108. <ContextMenu/>
  109. </Grid.ContextMenu>
  110. <Grid.RowDefinitions>
  111. <RowDefinition Height="Auto"/>
  112. <RowDefinition Height="*"/>
  113. </Grid.RowDefinitions>
  114. <Border BorderBrush="LightGray" BorderThickness="0,0,0,1" Margin="0,0,0,5">
  115. <StackPanel Orientation="Vertical"
  116. Grid.Row="0">
  117. <TextBlock Text="{Binding Title,Mode=OneWay}" FontSize="16" FontWeight="DemiBold" HorizontalAlignment="Left"
  118. Margin="10,0,10,0" />
  119. <TextBlock FontSize="12" HorizontalAlignment="Left" Margin="10,0,5,0">
  120. <Run Text="{Binding NumTasks,Mode=OneWay}" />
  121. <Run Text="Tasks /" />
  122. <Run Text="{Binding NumHours,Mode=OneWay, StringFormat={}{0:F2}}"/>
  123. <Run Text="Hours" />
  124. </TextBlock>
  125. </StackPanel>
  126. </Border>
  127. <ItemsControl Grid.Row="1" Margin="5,0"
  128. AllowDrop="True"
  129. DragOver="ItemsControl_DragOver"
  130. Drop="ItemsControl_Drop"
  131. Tag="{Binding}"
  132. ItemsSource="{Binding Tasks,Mode=OneWay}">
  133. <ItemsControl.Style>
  134. <Style TargetType="{x:Type ItemsControl}" BasedOn="{StaticResource VirtualisedItemsControlStyle}">
  135. <Setter Property="ItemTemplate" Value="{StaticResource FullKanban}"/>
  136. <Style.Triggers>
  137. <DataTrigger Binding="{Binding Mode,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:TasksByStatusControl}}}"
  138. Value="{x:Static local:KanbanViewMode.Compact}">
  139. <Setter Property="ItemTemplate" Value="{StaticResource CompactKanban}"/>
  140. </DataTrigger>
  141. </Style.Triggers>
  142. </Style>
  143. </ItemsControl.Style>
  144. </ItemsControl>
  145. </Grid>
  146. </Border>
  147. </DataTemplate>
  148. </ItemsControl.ItemTemplate>
  149. </ItemsControl>
  150. </Grid>
  151. </UserControl>