AWGMappingWindow.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <Window x:Class="PRSDesktop.Integrations.Common.AWGMappingWindow"
  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.Integrations.Common"
  7. xmlns:wpf="clr-namespace:InABox.WPF;assembly=InABox.Wpf"
  8. mc:Ignorable="d"
  9. Title="{Binding SelectedSection.Key, FallbackValue='Integration Mappings'}" Height="800" Width="1400" WindowStartupLocation="CenterScreen">
  10. <Window.DataContext>
  11. <local:AWGMappingWindowViewModel x:Name="ViewModel" />
  12. </Window.DataContext>
  13. <Window.Resources>
  14. <local:SectionToVisibilityConverter x:Key="StylesGridVisible" Key="Styles" />
  15. <local:SectionToVisibilityConverter x:Key="GroupsGridVisible" Key="Groups" />
  16. <local:SectionToVisibilityConverter x:Key="SuppliersGridVisible" Key="Suppliers" />
  17. <local:SectionToVisibilityConverter x:Key="DiscountsGridVisible" Key="Discounts" />
  18. <local:SectionToVisibilityConverter x:Key="ProfilesGridVisible" Key="Profiles" />
  19. <local:SectionToVisibilityConverter x:Key="GasketsGridVisible" Key="Gaskets" />
  20. <local:SectionToVisibilityConverter x:Key="ComponentsGridVisible" Key="Components" />
  21. <local:SectionToVisibilityConverter x:Key="GlassGridVisible" Key="Glass" />
  22. <local:SectionToVisibilityConverter x:Key="LabourGridVisible" Key="Labour" />
  23. <wpf:EnumerableToVisibilityConverter x:Key="IsNotEmpty"/>
  24. </Window.Resources>
  25. <Grid Margin="5">
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="Auto"/>
  28. <ColumnDefinition Width="*"/>
  29. </Grid.ColumnDefinitions>
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="*"/>
  32. <RowDefinition Height="Auto"/>
  33. </Grid.RowDefinitions>
  34. <ListView
  35. Grid.Row="0"
  36. Grid.Column="0"
  37. Width="120"
  38. SelectedItem="{Binding SelectedSection}"
  39. ItemsSource="{Binding Sections}"
  40. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  41. ScrollViewer.VerticalScrollBarVisibility="Auto">
  42. <ListView.ItemContainerStyle>
  43. <Style TargetType="ListViewItem">
  44. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  45. </Style>
  46. </ListView.ItemContainerStyle>
  47. <ListView.ItemTemplate>
  48. <DataTemplate>
  49. <Grid>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="50"/>
  52. <RowDefinition Height="Auto"/>
  53. </Grid.RowDefinitions>
  54. <Grid.ColumnDefinitions>
  55. <ColumnDefinition Width="*"/>
  56. </Grid.ColumnDefinitions>
  57. <Image
  58. Grid.Row="0"
  59. Source="{Binding Value}"
  60. VerticalAlignment="Center"
  61. HorizontalAlignment="Center"
  62. Margin="2"/>
  63. <Label
  64. Grid.Row="1"
  65. Content="{Binding Key}"
  66. Margin="5,0,5,5"
  67. HorizontalAlignment="Center"/>
  68. </Grid>
  69. </DataTemplate>
  70. </ListView.ItemTemplate>
  71. </ListView>
  72. <local:ProductStyleIntegrationGrid
  73. Grid.Row="0"
  74. Grid.Column="1"
  75. Margin="5,0,0,0"
  76. Visibility="{Binding SelectedSection, Converter={StaticResource StylesGridVisible}}"
  77. ItemsSource="{Binding StyleMappings}"
  78. CreateEntity="{Binding CreateStyle}"
  79. SourceType="{Binding SourceType}"
  80. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  81. <local:ProductGroupIntegrationGrid
  82. Grid.Row="0"
  83. Grid.Column="1"
  84. Margin="5,0,0,0"
  85. Visibility="{Binding SelectedSection, Converter={StaticResource GroupsGridVisible}}"
  86. ItemsSource="{Binding GroupMappings}"
  87. CreateEntity="{Binding CreateGroup}"
  88. SourceType="{Binding SourceType}"
  89. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  90. <local:SupplierIntegrationGrid
  91. Grid.Row="0"
  92. Grid.Column="1"
  93. Margin="5,0,0,0"
  94. Visibility="{Binding SelectedSection, Converter={StaticResource SuppliersGridVisible}}"
  95. ItemsSource="{Binding SupplierMappings}"
  96. CreateEntity="{Binding CreateSupplier}"
  97. SourceType="{Binding SourceType}"
  98. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  99. <local:DiscountIntegrationGrid
  100. Grid.Row="0"
  101. Grid.Column="1"
  102. Margin="5,0,0,0"
  103. Visibility="{Binding SelectedSection, Converter={StaticResource DiscountsGridVisible}}"
  104. ItemsSource="{Binding DiscountMappings}"
  105. CreateEntity="{Binding CreateDiscount}"
  106. AfterCreateEntity="{Binding AfterCreateDiscount}"
  107. SourceType="{Binding SourceType}"
  108. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  109. <local:ProfileIntegrationGrid
  110. Grid.Row="0"
  111. Grid.Column="1"
  112. Margin="5,0,0,0"
  113. Visibility="{Binding SelectedSection, Converter={StaticResource ProfilesGridVisible}}"
  114. ItemsSource="{Binding ProfileMappings}"
  115. CreateEntity="{Binding CreateProfile}"
  116. AfterCreateEntity="{Binding AfterCreateProduct}"
  117. SourceType="{Binding SourceType}"
  118. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  119. <local:GasketIntegrationGrid
  120. Grid.Row="0"
  121. Grid.Column="1"
  122. Margin="5,0,0,0"
  123. Visibility="{Binding SelectedSection, Converter={StaticResource GasketsGridVisible}}"
  124. ItemsSource="{Binding GasketMappings}"
  125. CreateEntity="{Binding CreateGasket}"
  126. AfterCreateEntity="{Binding AfterCreateProduct}"
  127. SourceType="{Binding SourceType}"
  128. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  129. <local:ComponentIntegrationGrid
  130. Grid.Row="0"
  131. Grid.Column="1"
  132. Margin="5,0,0,0"
  133. Visibility="{Binding SelectedSection, Converter={StaticResource ComponentsGridVisible}}"
  134. ItemsSource="{Binding ComponentMappings}"
  135. CreateEntity="{Binding CreateComponent}"
  136. AfterCreateEntity="{Binding AfterCreateProduct}"
  137. SourceType="{Binding SourceType}"
  138. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  139. <local:GlassIntegrationGrid
  140. Grid.Row="0"
  141. Grid.Column="1"
  142. Margin="5,0,0,0"
  143. Visibility="{Binding SelectedSection, Converter={StaticResource GlassGridVisible}}"
  144. ItemsSource="{Binding GlassMappings}"
  145. CreateEntity="{Binding CreateGlass}"
  146. AfterCreateEntity="{Binding AfterCreateProduct}"
  147. SourceType="{Binding SourceType}"
  148. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  149. <local:ActivityIntegrationGrid
  150. Grid.Row="0"
  151. Grid.Column="1"
  152. Margin="5,0,0,0"
  153. Visibility="{Binding SelectedSection, Converter={StaticResource LabourGridVisible}}"
  154. ItemsSource="{Binding LabourMappings}"
  155. CreateEntity="{Binding CreateActivity}"
  156. SourceType="{Binding SourceType}"
  157. OnChanged="BaseDynamicGrid_OnOnChanged"/>
  158. <DockPanel
  159. Grid.Row="1"
  160. Grid.Column="0"
  161. Grid.ColumnSpan="2"
  162. LastChildFill="False">
  163. <CheckBox
  164. DockPanel.Dock="Left"
  165. VerticalAlignment="Center"
  166. Margin="5,0,10,0"
  167. IsChecked="{Binding StylesChecked}"
  168. Visibility="{Binding Styles, Converter={StaticResource IsNotEmpty}}">Finishes</CheckBox>
  169. <CheckBox
  170. DockPanel.Dock="Left"
  171. VerticalAlignment="Center"
  172. Margin="5,0,10,0"
  173. IsChecked="{Binding GroupsChecked}"
  174. Visibility="{Binding Groups, Converter={StaticResource IsNotEmpty}}">Groups</CheckBox>
  175. <CheckBox
  176. DockPanel.Dock="Left"
  177. VerticalAlignment="Center"
  178. Margin="5,0,10,0"
  179. IsChecked="{Binding SuppliersChecked}"
  180. Visibility="{Binding Suppliers, Converter={StaticResource IsNotEmpty}}">Suppliers</CheckBox>
  181. <CheckBox
  182. DockPanel.Dock="Left"
  183. VerticalAlignment="Center"
  184. Margin="5,0,10,0"
  185. IsChecked="{Binding DiscountsChecked}"
  186. Visibility="{Binding Discounts, Converter={StaticResource IsNotEmpty}}">Discounts</CheckBox>
  187. <CheckBox
  188. DockPanel.Dock="Left"
  189. VerticalAlignment="Center"
  190. Margin="5,0,10,0"
  191. IsChecked="{Binding ProfilesChecked}"
  192. Visibility="{Binding Profiles, Converter={StaticResource IsNotEmpty}}">Profiles</CheckBox>
  193. <CheckBox
  194. DockPanel.Dock="Left"
  195. VerticalAlignment="Center"
  196. Margin="5,0,10,0"
  197. IsChecked="{Binding GasketsChecked}"
  198. Visibility="{Binding Gaskets, Converter={StaticResource IsNotEmpty}}">Gaskets</CheckBox>
  199. <CheckBox
  200. DockPanel.Dock="Left"
  201. VerticalAlignment="Center"
  202. Margin="5,0,10,0"
  203. IsChecked="{Binding ComponentsChecked}"
  204. Visibility="{Binding Components, Converter={StaticResource IsNotEmpty}}">Components</CheckBox>
  205. <CheckBox
  206. DockPanel.Dock="Left"
  207. VerticalAlignment="Center"
  208. Margin="5,0,10,0"
  209. IsChecked="{Binding GlassChecked}"
  210. Visibility="{Binding Glass, Converter={StaticResource IsNotEmpty}}">Glass</CheckBox>
  211. <CheckBox
  212. DockPanel.Dock="Left"
  213. VerticalAlignment="Center"
  214. Margin="5,0,10,0"
  215. IsChecked="{Binding LabourChecked}"
  216. Visibility="{Binding Labour, Converter={StaticResource IsNotEmpty}}">Labour</CheckBox>
  217. <Button
  218. DockPanel.Dock="Right"
  219. Width="80"
  220. Height="40"
  221. Content="Cancel"
  222. Margin="5,5,0,0"
  223. Click="CancelClick"/>
  224. <Button
  225. DockPanel.Dock="Right"
  226. Width="80"
  227. Height="40"
  228. Content="OK"
  229. Margin="5,5,0,0"
  230. Click="OKClick"
  231. IsEnabled="{Binding MappingsComplete}"/>
  232. </DockPanel>
  233. </Grid>
  234. </Window>