AWGMappingWindow.xaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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:dynamicGrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
  8. mc:Ignorable="d"
  9. Title="{Binding SelectedSection.Key, FallbackValue='Integration Mappings'}" Height="1000" Width="1000" WindowStartupLocation="CenterScreen">
  10. <Window.DataContext>
  11. <local:AWGMappingWindowViewModel x:Name="ViewModel" />
  12. </Window.DataContext>
  13. <Window.Resources>
  14. <local:SectionToVisibilityConverter x:Key="StylesGridVisible" Key="Finishes" />
  15. <local:SectionToVisibilityConverter x:Key="ProfilesGridVisible" Key="Profiles" />
  16. <local:SectionToVisibilityConverter x:Key="GasketsGridVisible" Key="Gaskets" />
  17. <local:SectionToVisibilityConverter x:Key="ComponentsGridVisible" Key="Components" />
  18. <local:SectionToVisibilityConverter x:Key="GlassGridVisible" Key="Glass" />
  19. <local:SectionToVisibilityConverter x:Key="LabourGridVisible" Key="Labour" />
  20. </Window.Resources>
  21. <Grid Margin="5">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="Auto"/>
  24. <ColumnDefinition Width="*"/>
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="*"/>
  28. <RowDefinition Height="Auto"/>
  29. </Grid.RowDefinitions>
  30. <ListView
  31. Grid.Row="0"
  32. Grid.Column="0"
  33. Width="100"
  34. SelectedItem="{Binding SelectedSection}"
  35. ItemsSource="{Binding Sections}"
  36. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  37. ScrollViewer.VerticalScrollBarVisibility="Auto">
  38. <ListView.ItemContainerStyle>
  39. <Style TargetType="ListViewItem">
  40. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  41. </Style>
  42. </ListView.ItemContainerStyle>
  43. <ListView.ItemTemplate>
  44. <DataTemplate>
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="50"/>
  48. <RowDefinition Height="Auto"/>
  49. </Grid.RowDefinitions>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="*"/>
  52. </Grid.ColumnDefinitions>
  53. <Image
  54. Grid.Row="0"
  55. Source="{Binding Value}"
  56. VerticalAlignment="Center"
  57. HorizontalAlignment="Center"
  58. Margin="2"/>
  59. <Label
  60. Grid.Row="1"
  61. Content="{Binding Key}"
  62. Margin="5,0,5,5"
  63. HorizontalAlignment="Center"/>
  64. </Grid>
  65. </DataTemplate>
  66. </ListView.ItemTemplate>
  67. </ListView>
  68. <local:ProductStyleIntegrationGrid
  69. Grid.Row="0"
  70. Grid.Column="1"
  71. Margin="5,0,0,0"
  72. Visibility="{Binding SelectedSection, Converter={StaticResource StylesGridVisible}}"
  73. ItemsSource="{Binding FinishMappings}"
  74. CreateEntity="{Binding CreateStyle}"/>
  75. <local:ProductIntegrationGrid
  76. Grid.Row="0"
  77. Grid.Column="1"
  78. Margin="5,0,0,0"
  79. Visibility="{Binding SelectedSection, Converter={StaticResource ProfilesGridVisible}}"
  80. ItemsSource="{Binding ProfileMappings}"
  81. CreateEntity="{Binding CreateProfile}"/>
  82. <local:ProductIntegrationGrid
  83. Grid.Row="0"
  84. Grid.Column="1"
  85. Margin="5,0,0,0"
  86. Visibility="{Binding SelectedSection, Converter={StaticResource GasketsGridVisible}}"
  87. ItemsSource="{Binding GasketMappings}"
  88. CreateEntity="{Binding CreateGasket}"/>
  89. <local:ProductIntegrationGrid
  90. Grid.Row="0"
  91. Grid.Column="1"
  92. Margin="5,0,0,0"
  93. Visibility="{Binding SelectedSection, Converter={StaticResource ComponentsGridVisible}}"
  94. ItemsSource="{Binding ComponentMappings}"
  95. CreateEntity="{Binding CreateComponent}"/>
  96. <local:ProductIntegrationGrid
  97. Grid.Row="0"
  98. Grid.Column="1"
  99. Margin="5,0,0,0"
  100. Visibility="{Binding SelectedSection, Converter={StaticResource GlassGridVisible}}"
  101. ItemsSource="{Binding GlassMappings}"
  102. CreateEntity="{Binding CreateGlass}"/>
  103. <local:ActivityIntegrationGrid
  104. Grid.Row="0"
  105. Grid.Column="1"
  106. Margin="5,0,0,0"
  107. Visibility="{Binding SelectedSection, Converter={StaticResource LabourGridVisible}}"
  108. ItemsSource="{Binding LabourMappings}"
  109. CreateEntity="{Binding CreateActivity}"/>
  110. <DockPanel
  111. Grid.Row="1"
  112. Grid.Column="0"
  113. Grid.ColumnSpan="2"
  114. LastChildFill="False">
  115. <Button
  116. DockPanel.Dock="Right"
  117. Width="80"
  118. Height="40"
  119. Content="Cancel"
  120. Margin="5,5,0,0"
  121. Click="CancelClick"/>
  122. <Button
  123. DockPanel.Dock="Right"
  124. Width="80"
  125. Height="40"
  126. Content="OK"
  127. Margin="5,5,0,0"
  128. Click="OKClick"
  129. IsEnabled="{Binding MappingsComplete}"/>
  130. </DockPanel>
  131. </Grid>
  132. </Window>