AWGMappingWindow.xaml 10 KB

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