AWGMappingWindow.xaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. SourceType="{Binding SourceType}"/>
  76. <local:ProductIntegrationGrid
  77. Grid.Row="0"
  78. Grid.Column="1"
  79. Margin="5,0,0,0"
  80. Visibility="{Binding SelectedSection, Converter={StaticResource ProfilesGridVisible}}"
  81. ItemsSource="{Binding ProfileMappings}"
  82. CreateEntity="{Binding CreateProfile}"
  83. SourceType="{Binding SourceType}"/>
  84. <local:ProductIntegrationGrid
  85. Grid.Row="0"
  86. Grid.Column="1"
  87. Margin="5,0,0,0"
  88. Visibility="{Binding SelectedSection, Converter={StaticResource GasketsGridVisible}}"
  89. ItemsSource="{Binding GasketMappings}"
  90. CreateEntity="{Binding CreateGasket}"
  91. SourceType="{Binding SourceType}"/>
  92. <local:ProductIntegrationGrid
  93. Grid.Row="0"
  94. Grid.Column="1"
  95. Margin="5,0,0,0"
  96. Visibility="{Binding SelectedSection, Converter={StaticResource ComponentsGridVisible}}"
  97. ItemsSource="{Binding ComponentMappings}"
  98. CreateEntity="{Binding CreateComponent}"
  99. SourceType="{Binding SourceType}"/>
  100. <local:ProductIntegrationGrid
  101. Grid.Row="0"
  102. Grid.Column="1"
  103. Margin="5,0,0,0"
  104. Visibility="{Binding SelectedSection, Converter={StaticResource GlassGridVisible}}"
  105. ItemsSource="{Binding GlassMappings}"
  106. CreateEntity="{Binding CreateGlass}"
  107. SourceType="{Binding SourceType}"/>
  108. <local:ActivityIntegrationGrid
  109. Grid.Row="0"
  110. Grid.Column="1"
  111. Margin="5,0,0,0"
  112. Visibility="{Binding SelectedSection, Converter={StaticResource LabourGridVisible}}"
  113. ItemsSource="{Binding LabourMappings}"
  114. CreateEntity="{Binding CreateActivity}"
  115. SourceType="{Binding SourceType}"/>
  116. <DockPanel
  117. Grid.Row="1"
  118. Grid.Column="0"
  119. Grid.ColumnSpan="2"
  120. LastChildFill="False">
  121. <Button
  122. DockPanel.Dock="Right"
  123. Width="80"
  124. Height="40"
  125. Content="Cancel"
  126. Margin="5,5,0,0"
  127. Click="CancelClick"/>
  128. <Button
  129. DockPanel.Dock="Right"
  130. Width="80"
  131. Height="40"
  132. Content="OK"
  133. Margin="5,5,0,0"
  134. Click="OKClick"
  135. IsEnabled="{Binding MappingsComplete}"/>
  136. </DockPanel>
  137. </Grid>
  138. </Window>