IntegrationBOMWindow.xaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. <local:ProductIntegrationGrid
  74. Grid.Row="0"
  75. Grid.Column="1"
  76. Margin="5,0,0,0"
  77. Visibility="{Binding SelectedSection, Converter={StaticResource ProfilesGridVisible}}"
  78. ItemsSource="{Binding Profiles}"/>
  79. <local:ProductIntegrationGrid
  80. Grid.Row="0"
  81. Grid.Column="1"
  82. Margin="5,0,0,0"
  83. Visibility="{Binding SelectedSection, Converter={StaticResource ComponentsGridVisible}}"
  84. ItemsSource="{Binding Components}"/>
  85. <local:ProductIntegrationGrid
  86. Grid.Row="0"
  87. Grid.Column="1"
  88. Margin="5,0,0,0"
  89. Visibility="{Binding SelectedSection, Converter={StaticResource GlassGridVisible}}"
  90. ItemsSource="{Binding Glass}"/>
  91. <local:ActivityIntegrationGrid
  92. Grid.Row="0"
  93. Grid.Column="1"
  94. Margin="5,0,0,0"
  95. Visibility="{Binding SelectedSection, Converter={StaticResource LabourGridVisible}}"
  96. ItemsSource="{Binding Labour}"/>
  97. <DockPanel
  98. Grid.Row="1"
  99. Grid.Column="0"
  100. Grid.ColumnSpan="2"
  101. LastChildFill="False">
  102. <Button
  103. DockPanel.Dock="Right"
  104. Width="80"
  105. Height="40"
  106. Content="Cancel"
  107. Margin="5,5,0,0"
  108. Click="CancelClick"/>
  109. <Button
  110. DockPanel.Dock="Right"
  111. Width="80"
  112. Height="40"
  113. Content="OK"
  114. Margin="5,5,0,0"
  115. Click="OKClick"/>
  116. </DockPanel>
  117. </Grid>
  118. </Window>