IntegrationBOMWindow.xaml 5.5 KB

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