JobDocumentSetTree.xaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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="300">
  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="2*"/>
  20. <RowDefinition Height="2*"/>
  21. <RowDefinition Height="*"/>
  22. </Grid.RowDefinitions>
  23. <TextBlock
  24. Grid.Row="1"
  25. Tag="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=ID}"
  26. Text="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=Code}"
  27. VerticalAlignment="Center"
  28. FontWeight="Bold"
  29. Margin="10,0,0,0"
  30. />
  31. <TextBlock
  32. Grid.Row="2"
  33. Tag="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=ID}"
  34. Text="{Binding Path=Value, Converter={StaticResource descriptionConverter}, ConverterParameter=Description}"
  35. VerticalAlignment="Center"
  36. Margin="10,0,0,0"
  37. />
  38. </Grid>
  39. </DataTemplate>
  40. <DataTemplate x:Key="detailsTemplate">
  41. <Grid>
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="*"/>
  44. <RowDefinition Height="*"/>
  45. <RowDefinition Height="*"/>
  46. </Grid.RowDefinitions>
  47. <TextBlock
  48. Grid.Row="0"
  49. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  50. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Size}"
  51. TextAlignment="Center"
  52. FontWeight="Bold"
  53. Margin="0,2,0,0"
  54. />
  55. <TextBlock
  56. Grid.Row="1"
  57. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  58. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Employee}"
  59. TextAlignment="Center"
  60. />
  61. <TextBlock
  62. Grid.Row="2"
  63. Tag="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=ID}"
  64. Text="{Binding Path=Value, Converter={StaticResource detailsConverter}, ConverterParameter=Date}"
  65. TextAlignment="Center"
  66. Margin="0,0,0,2"
  67. />
  68. </Grid>
  69. </DataTemplate>
  70. <DataTemplate x:Key="milestoneTemplate">
  71. <Grid Background="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Color}">
  72. <Grid.RowDefinitions>
  73. <RowDefinition Height="*"/>
  74. <RowDefinition Height="*"/>
  75. <RowDefinition Height="*"/>
  76. </Grid.RowDefinitions>
  77. <TextBlock
  78. Grid.Row="0"
  79. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  80. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Revision}"
  81. TextAlignment="Center"
  82. VerticalAlignment="Center"
  83. FontWeight="Bold"
  84. Margin="0,2,0,0"
  85. />
  86. <TextBlock
  87. Grid.Row="1"
  88. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  89. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Status}"
  90. TextAlignment="Center"
  91. />
  92. <TextBlock
  93. Grid.Row="2"
  94. Tag="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=ID}"
  95. Text="{Binding Path=Value, Converter={StaticResource milestoneConverter}, ConverterParameter=Date}"
  96. TextAlignment="Center"
  97. Margin="0,0,0,2"
  98. />
  99. </Grid>
  100. </DataTemplate>
  101. <Style TargetType="Syncfusion:TreeGridHeaderCell" x:Key="headerStyle">
  102. <Setter Property="FontWeight" Value="Bold"/>
  103. <Setter Property="Foreground" Value="Black"/>
  104. <Setter Property="FontSize" Value="12"/>
  105. <Setter Property="Background" Value="LightSkyBlue"/>
  106. </Style>
  107. <Style TargetType="Syncfusion:TreeGridStackedHeaderCell">
  108. <Setter Property="FontWeight" Value="Bold"/>
  109. <Setter Property="Foreground" Value="Black"/>
  110. <Setter Property="FontSize" Value="12"/>
  111. <Setter Property="Background" Value="LightSkyBlue"/>
  112. </Style>
  113. <Style TargetType="Syncfusion:TreeGridRowControl" x:Key="rowStyle">
  114. <Setter Property="Background" Value="White"/>
  115. </Style>
  116. <!-- <Style TargetType="Syncfusion:TreeGridExpanderCell"> -->
  117. <!-- <Setter Property="Background" Value="LightSalmon"/> -->
  118. <!-- </Style> -->
  119. </UserControl.Resources>
  120. <Grid>
  121. <Grid.RowDefinitions>
  122. <RowDefinition Height="*"/>
  123. <RowDefinition Height="Auto"/>
  124. </Grid.RowDefinitions>
  125. <!-- SelectionUnit="Cell" -->
  126. <!-- QueryRowHeight="DataGrid_OnQueryRowHeight" -->
  127. <Syncfusion:SfTreeGrid
  128. x:Name="treeGrid"
  129. Grid.Row="0"
  130. AutoGenerateColumns="False"
  131. ChildPropertyName="Children"
  132. AutoExpandMode="AllNodesExpanded"
  133. NodeCollapsing="TreeGrid_OnNodeCollapsing"
  134. RowHeight="60"
  135. AllowSorting="False"
  136. HeaderRowHeight="30"
  137. NavigationMode="Cell"
  138. SelectionMode="Extended"
  139. ColumnSizer="Auto"
  140. Background="DimGray"
  141. HeaderStyle="{StaticResource headerStyle}"
  142. RowStyle="{StaticResource rowStyle}"
  143. CellToolTipOpening="TreeGrid_OnCellToolTipOpening"
  144. ContextMenuOpening="TreeGrid_OnContextMenuOpening"
  145. ItemsSourceChanged="TreeGrid_OnItemsSourceChanged"
  146. SelectionChanged="TreeGrid_OnSelectionChanged"
  147. CurrentCellActivated="TreeGrid_OnCurrentCellActivated"
  148. >
  149. <Syncfusion:SfTreeGrid.StackedHeaderRows>
  150. <Syncfusion:StackedHeaderRow x:Name="stackedHeaderRow" />
  151. </Syncfusion:SfTreeGrid.StackedHeaderRows>
  152. <Syncfusion:SfTreeGrid.ContextMenu>
  153. <ContextMenu x:Name="MileStoneMenu" />
  154. </Syncfusion:SfTreeGrid.ContextMenu>
  155. </Syncfusion:SfTreeGrid>
  156. <DockPanel Grid.Row="1">
  157. <Button x:Name="Add" DockPanel.Dock="Left" Margin="0,2,2,0" Width="30" Height="30"
  158. Padding="2" Click="Add_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  159. <Image x:Name="AddImage" Source="../../Resources/add.png" />
  160. </Button>
  161. <Button x:Name="Edit" DockPanel.Dock="Left" Margin="0,2,2,0" Width="30" Height="30"
  162. Padding="2" Click="Edit_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  163. <Image x:Name="EditImage" Source="../../Resources/pencil.png" />
  164. </Button>
  165. <Button x:Name="FlatList" DockPanel.Dock="Left" Margin="0,2,2,0"
  166. Click="FlatList_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  167. <Label x:Name="FlatListLabel" Content="Flat List" />
  168. </Button>
  169. <Button x:Name="HideRejected" DockPanel.Dock="Left" Margin="0,2,2,0"
  170. Click="HideRejected_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  171. <Label x:Name="HideSupercededLabel" Content="Last Only" />
  172. </Button>
  173. <Button x:Name="IncludeRetired" DockPanel.Dock="Left" Margin="0,2,2,0"
  174. Click="IncludeRetired_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  175. <Label x:Name="IncludeRetiredLabel" Content="Include Retired" />
  176. </Button>
  177. <Button x:Name="Delete" DockPanel.Dock="Right" Margin="2,2,0,0" Width="30" Height="30"
  178. Padding="2" Click="Delete_OnClick" BorderBrush="Gray" BorderThickness="0.75">
  179. <Image x:Name="DeleteImage" Source="../../Resources/delete.png" />
  180. </Button>
  181. <Label DockPanel.Dock="Left"/>
  182. </DockPanel>
  183. </Grid>
  184. </UserControl>