JobDocumentSetTree.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <UserControl x:Class="PRSDesktop.JobDocumentSetTree"
  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. xmlns:Syncfusion="http://schemas.syncfusion.com/wpf"
  8. xmlns:sfgrid="clr-namespace:Syncfusion.UI.Xaml.Grid;assembly=Syncfusion.SfGrid.WPF"
  9. mc:Ignorable="d"
  10. d:DesignHeight="300" d:DesignWidth="800">
  11. <UserControl.Resources>
  12. <local:JobDocumentSetDescriptionConverter x:Key="descriptionConverter" />
  13. <local:JobDocumentSetDetailsConverter x:Key="detailsConverter" />
  14. <local:JobDocumentSetMileStoneConverter x:Key="milestoneConverter" />
  15. <DataTemplate x:Key="descriptionTemplate">
  16. <Grid>
  17. <Grid.RowDefinitions>
  18. <RowDefinition Height="*"/>
  19. <RowDefinition Height="*"/>
  20. <RowDefinition Height="*"/>
  21. </Grid.RowDefinitions>
  22. <TextBlock
  23. Grid.Row="0"
  24. Tag="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=ID}"
  25. Text="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=Code}"
  26. VerticalAlignment="Center"
  27. FontWeight="Bold"
  28. Margin="10,2,0,0"
  29. />
  30. <TextBlock
  31. Grid.Row="1"
  32. Tag="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=ID}"
  33. Text="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=Description}"
  34. VerticalAlignment="Center"
  35. Margin="10,0,0,0"
  36. />
  37. <TextBlock
  38. Grid.Row="2"
  39. Tag="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=ID}"
  40. Text="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=Tags}"
  41. FontStyle="Italic"
  42. VerticalAlignment="Center"
  43. Margin="10,0,0,2"
  44. />
  45. </Grid>
  46. </DataTemplate>
  47. <DataTemplate x:Key="detailsTemplate">
  48. <Grid>
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="*"/>
  51. <RowDefinition Height="*"/>
  52. <RowDefinition Height="*"/>
  53. </Grid.RowDefinitions>
  54. <TextBlock
  55. Grid.Row="0"
  56. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  57. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Size}"
  58. TextAlignment="Center"
  59. FontWeight="Bold"
  60. Margin="0,2,0,0"
  61. />
  62. <TextBlock
  63. Grid.Row="1"
  64. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  65. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Employee}"
  66. TextAlignment="Center"
  67. />
  68. <TextBlock
  69. Grid.Row="2"
  70. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  71. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Date}"
  72. TextAlignment="Center"
  73. Margin="0,0,0,2"
  74. />
  75. </Grid>
  76. </DataTemplate>
  77. <DataTemplate x:Key="milestoneTemplate">
  78. <Grid Background="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Color}">
  79. <Grid.RowDefinitions>
  80. <RowDefinition Height="*"/>
  81. <RowDefinition Height="*"/>
  82. <RowDefinition Height="*"/>
  83. </Grid.RowDefinitions>
  84. <Grid.ColumnDefinitions>
  85. <ColumnDefinition Width="*"/>
  86. <ColumnDefinition Width="Auto"/>
  87. </Grid.ColumnDefinitions>
  88. <TextBlock
  89. Grid.Row="0"
  90. Grid.Column="0"
  91. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  92. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Revision}"
  93. TextAlignment="Center"
  94. VerticalAlignment="Center"
  95. FontWeight="Bold"
  96. Margin="0,2,0,0"
  97. />
  98. <Image
  99. Grid.Row="0"
  100. Grid.Column="1"
  101. Source="../../../../Resources/speechbubble.png"
  102. Width="16"
  103. Height="16"
  104. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  105. Visibility="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Kanbans}" />
  106. <TextBlock
  107. Grid.Row="1"
  108. Grid.Column="0"
  109. Grid.ColumnSpan="2"
  110. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  111. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Status}"
  112. TextAlignment="Center"
  113. />
  114. <TextBlock
  115. Grid.Row="2"
  116. Grid.Column="0"
  117. Grid.ColumnSpan="2"
  118. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  119. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Date}"
  120. TextAlignment="Center"
  121. Margin="0,0,0,2"
  122. />
  123. </Grid>
  124. </DataTemplate>
  125. <Style TargetType="Syncfusion:TreeGridHeaderCell" x:Key="headerStyle">
  126. <Setter Property="FontWeight" Value="Bold"/>
  127. <Setter Property="Foreground" Value="Black"/>
  128. <Setter Property="FontSize" Value="12"/>
  129. <Setter Property="Background" Value="LightSkyBlue"/>
  130. </Style>
  131. <Style TargetType="Syncfusion:TreeGridStackedHeaderCell">
  132. <Setter Property="FontWeight" Value="Bold"/>
  133. <Setter Property="Foreground" Value="Black"/>
  134. <Setter Property="FontSize" Value="12"/>
  135. <Setter Property="Background" Value="LightSkyBlue"/>
  136. </Style>
  137. <Style TargetType="Syncfusion:TreeGridRowControl" x:Key="rowStyle">
  138. <Setter Property="Background" Value="White"/>
  139. </Style>
  140. <!-- <Style TargetType="Syncfusion:TreeGridExpanderCell"> -->
  141. <!-- <Setter Property="Background" Value="LightSalmon"/> -->
  142. <!-- </Style> -->
  143. </UserControl.Resources>
  144. <Grid x:Name="ContainerGrid">
  145. <Grid.RowDefinitions>
  146. <RowDefinition Height="*"/>
  147. <RowDefinition Height="Auto"/>
  148. </Grid.RowDefinitions>
  149. <!-- SelectionUnit="Cell" -->
  150. <!-- QueryRowHeight="DataGrid_OnQueryRowHeight" -->
  151. <Border x:Name="TreeBorder" AllowDrop="True"
  152. Drop="Grid_Drop">
  153. <Syncfusion:SfTreeGrid x:Name="treeGrid"
  154. Grid.Row="0"
  155. AutoGenerateColumns="False"
  156. ChildPropertyName="Children"
  157. AutoExpandMode="AllNodesExpanded"
  158. NodeCollapsing="TreeGrid_OnNodeCollapsing"
  159. RowHeight="60"
  160. AllowSorting="False"
  161. HeaderRowHeight="30"
  162. NavigationMode="Cell"
  163. SelectionMode="Extended"
  164. ColumnSizer="Auto"
  165. Background="DimGray"
  166. HeaderStyle="{StaticResource headerStyle}"
  167. RowStyle="{StaticResource rowStyle}"
  168. CellToolTipOpening="TreeGrid_OnCellToolTipOpening"
  169. ContextMenuOpening="TreeGrid_OnContextMenuOpening"
  170. ItemsSourceChanged="TreeGrid_OnItemsSourceChanged"
  171. SelectionChanged="TreeGrid_OnSelectionChanged"
  172. CurrentCellActivated="TreeGrid_OnCurrentCellActivated"
  173. CellDoubleTapped="TreeGrid_OnCellDoubleTapped"
  174. AllowDraggingRows="False"
  175. AllowDrop="False">
  176. <Syncfusion:SfTreeGrid.StackedHeaderRows>
  177. <Syncfusion:StackedHeaderRow x:Name="stackedHeaderRow" />
  178. </Syncfusion:SfTreeGrid.StackedHeaderRows>
  179. <Syncfusion:SfTreeGrid.ContextMenu>
  180. <ContextMenu x:Name="MileStoneMenu" />
  181. </Syncfusion:SfTreeGrid.ContextMenu>
  182. </Syncfusion:SfTreeGrid>
  183. </Border>
  184. <DockPanel Grid.Row="1">
  185. <Button x:Name="Add" DockPanel.Dock="Left" Margin="0,2,2,0" Width="30" Height="30"
  186. Padding="2" Click="Add_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  187. <Image x:Name="AddImage" Source="../../Resources/add.png" />
  188. </Button>
  189. <Button x:Name="Edit" DockPanel.Dock="Left" Margin="0,2,2,0" Width="30" Height="30"
  190. Padding="2" Click="Edit_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  191. <Image x:Name="EditImage" Source="../../Resources/pencil.png" />
  192. </Button>
  193. <Button x:Name="FlatList" DockPanel.Dock="Left" Margin="0,2,2,0"
  194. Click="FlatList_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  195. <Label x:Name="FlatListLabel" Content="Flat List" />
  196. </Button>
  197. <Button x:Name="HideRejected" DockPanel.Dock="Left" Margin="0,2,2,0"
  198. Click="HideRejected_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  199. <Label x:Name="HideSupercededLabel" Content="Last Only" />
  200. </Button>
  201. <Button x:Name="IncludeRetired" DockPanel.Dock="Left" Margin="0,2,2,0"
  202. Click="IncludeRetired_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  203. <Label x:Name="IncludeRetiredLabel" Content="Include Retired" />
  204. </Button>
  205. <Button x:Name="Export" DockPanel.Dock="Left" Margin="0,2,2,0"
  206. Click="Export_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  207. <Label x:Name="ExportLabel" Content="Export" />
  208. </Button>
  209. <Button x:Name="Delete" DockPanel.Dock="Right" Margin="2,2,0,0" Width="30" Height="30"
  210. Padding="2" Click="Delete_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  211. <Image x:Name="DeleteImage" Source="../../Resources/delete.png" />
  212. </Button>
  213. <Label x:Name="DocumentCount" DockPanel.Dock="Left" Content="0 Document Sets" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
  214. </DockPanel>
  215. </Grid>
  216. </UserControl>