FocusGoodsSelectView.xaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <windows:WindowBase x:Class="Muchinfo.MTPClient.UI.Views.FocusGoodsSelectView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:command="http://www.galasoft.ch/mvvmlight"
  5. xmlns:data="clr-namespace:Muchinfo.MTPClient.Data;assembly=Muchinfo.MTPClient.Data"
  6. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  7. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Muchinfo.MTPClient.Resources"
  8. xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Muchinfo.WPF.Controls"
  9. x:Name="FocusGoodsView"
  10. Title="{x:Static resource:Muchinfo_Resource.FocusGoodsSelect_Title}"
  11. Width="450"
  12. Height="350"
  13. Style="{DynamicResource WindowBaseStyle}">
  14. <Grid Margin="20,10">
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="*" />
  17. <RowDefinition Height="Auto" />
  18. </Grid.RowDefinitions>
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="3*" />
  21. <ColumnDefinition Width="2*" />
  22. <ColumnDefinition Width="3*" />
  23. </Grid.ColumnDefinitions>
  24. <TreeView x:Name="ExchangeTreeView"
  25. ItemsSource="{Binding ExchangeList}"
  26. SelectedValuePath="Key">
  27. <TreeView.ItemContainerStyle>
  28. <Style TargetType="TreeViewItem">
  29. <Setter Property="TreeViewItem.IsExpanded" Value="True" />
  30. </Style>
  31. </TreeView.ItemContainerStyle>
  32. <TreeView.ItemTemplate>
  33. <HierarchicalDataTemplate DataType="{x:Type data:TreeViewEntity}" ItemsSource="{Binding Path=Children}">
  34. <StackPanel Orientation="Horizontal">
  35. <TextBlock VerticalAlignment="Center" Text="{Binding Value}" />
  36. </StackPanel>
  37. </HierarchicalDataTemplate>
  38. </TreeView.ItemTemplate>
  39. <i:Interaction.Triggers>
  40. <i:EventTrigger EventName="MouseDoubleClick">
  41. <command:EventToCommand Command="{Binding InCommand}" CommandParameter="{Binding Path=SelectedItem, ElementName=ExchangeTreeView}" />
  42. </i:EventTrigger>
  43. </i:Interaction.Triggers>
  44. </TreeView>
  45. <Grid Grid.Row="0" Grid.Column="1">
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto" />
  48. <RowDefinition Height="*" />
  49. <RowDefinition Height="Auto" />
  50. </Grid.RowDefinitions>
  51. <StackPanel Margin="0,20,0,0" Orientation="Vertical">
  52. <Button x:Name="InButton"
  53. Width="70"
  54. Margin="0,10,0,10"
  55. Background="{DynamicResource MuchinfoBrush13}"
  56. Command="{Binding InCommand}"
  57. CommandParameter="{Binding Path=SelectedItem,
  58. ElementName=ExchangeTreeView}"
  59. Padding="3"
  60. Style="{StaticResource CommonButtonStyle}">
  61. <Button.Content>
  62. <StackPanel Orientation="Horizontal">
  63. <TextBlock Text="{x:Static resource:Muchinfo_Resource.Button_InSelected}" />
  64. <TextBlock Text="&gt;&gt;" />
  65. </StackPanel>
  66. </Button.Content>
  67. </Button>
  68. <Button x:Name="OutButton"
  69. Width="70"
  70. Margin="0,0,0,10"
  71. Background="{DynamicResource MuchinfoBrush13}"
  72. Command="{Binding OutCommand}"
  73. CommandParameter="{Binding Path=SelectedItem,
  74. ElementName=SelectedListBox}"
  75. Padding="3"
  76. Style="{StaticResource CommonButtonStyle}">
  77. <Button.Content>
  78. <StackPanel Orientation="Horizontal">
  79. <TextBlock Text="&lt;&lt;" />
  80. <TextBlock Text="{x:Static resource:Muchinfo_Resource.Button_OutSelected}" />
  81. </StackPanel>
  82. </Button.Content>
  83. </Button>
  84. </StackPanel>
  85. <StackPanel Grid.Row="2"
  86. Margin="0,0,0,20"
  87. Orientation="Vertical">
  88. <Button x:Name="UpButton"
  89. Width="70"
  90. Margin="0,10,0,10"
  91. Background="{DynamicResource MuchinfoBrush13}"
  92. Command="{Binding UpCommand}"
  93. CommandParameter="{Binding ElementName=SelectedListBox}"
  94. Content="{x:Static resource:Muchinfo_Resource.Button_Up}"
  95. Padding="3"
  96. Style="{StaticResource CommonButtonStyle}" />
  97. <Button x:Name="DownButton"
  98. Width="70"
  99. Margin="0,0,0,10"
  100. Background="{DynamicResource MuchinfoBrush13}"
  101. Command="{Binding DownCommand}"
  102. CommandParameter="{Binding ElementName=SelectedListBox}"
  103. Content="{x:Static resource:Muchinfo_Resource.Button_Down}"
  104. Padding="3"
  105. Style="{StaticResource CommonButtonStyle}" />
  106. </StackPanel>
  107. </Grid>
  108. <ListBox x:Name="SelectedListBox"
  109. Grid.Row="0"
  110. Grid.Column="2"
  111. DisplayMemberPath="Value"
  112. ItemsSource="{Binding SelectedItems}"
  113. SelectedItem="{Binding CurrentListViewEntity,
  114. Mode=TwoWay}"
  115. SelectedValuePath="Key"
  116. SelectionMode="Single">
  117. <i:Interaction.Triggers>
  118. <i:EventTrigger EventName="MouseDoubleClick">
  119. <command:EventToCommand Command="{Binding OutCommand}" CommandParameter="{Binding Path=SelectedItem, ElementName=SelectedListBox}" />
  120. </i:EventTrigger>
  121. </i:Interaction.Triggers>
  122. </ListBox>
  123. <StackPanel Grid.Row="1"
  124. Grid.Column="1"
  125. Grid.ColumnSpan="2"
  126. Margin="0,10,0,0"
  127. HorizontalAlignment="Right"
  128. Orientation="Horizontal">
  129. <Button x:Name="OkButton"
  130. Width="70"
  131. Background="{DynamicResource MuchinfoBrush13}"
  132. Command="{Binding OKCommand}"
  133. CommandParameter="{Binding ElementName=FocusGoodsView}"
  134. Content="{x:Static resource:Muchinfo_Resource.Button_Confirm}"
  135. IsDefault="True"
  136. Padding="5"
  137. Style="{StaticResource CommonButtonStyle}" />
  138. <Button x:Name="CancelButton"
  139. Width="70"
  140. Margin="10,0,0,0"
  141. Background="{DynamicResource MuchinfoBrush13}"
  142. Command="{Binding CancelCommand}"
  143. CommandParameter="{Binding ElementName=FocusGoodsView}"
  144. Content="{x:Static resource:Muchinfo_Resource.Button_Cancel}"
  145. Padding="5"
  146. Style="{StaticResource CommonButtonStyle}" />
  147. </StackPanel>
  148. </Grid>
  149. </windows:WindowBase>