CloseFrameView.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <windows:WindowBase x:Class="Muchinfo.MTPClient.Trade.Views.CloseFrameView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Muchinfo.MTPClient.Infrastructure"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:resources="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Muchinfo.MTPClient.Resources"
  8. xmlns:views="clr-namespace:Muchinfo.MTPClient.Trade.Views"
  9. xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Muchinfo.WPF.Controls"
  10. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  11. xmlns:zoom="clr-namespace:Muchinfo.WPF.Controls.Zoom;assembly=Muchinfo.WPF.Controls"
  12. x:Name="CloseWindowBase"
  13. Title="{Binding Title}"
  14. Width="500"
  15. Height="500"
  16. ClosedCommand="{Binding ClosedCommand}"
  17. ShowInTaskbar="False"
  18. Style="{DynamicResource WindowBaseStyle}"
  19. mc:Ignorable="d">
  20. <windows:WindowBase.Resources>
  21. <BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
  22. <converters:BoolOpposedVisibility x:Key="BoolOpposedVisibility" />
  23. <Style TargetType="{x:Type TextBlock}">
  24. <Setter Property="FontWeight" Value="Bold" />
  25. <Setter Property="HorizontalAlignment" Value="Right" />
  26. <Setter Property="VerticalAlignment" Value="Center" />
  27. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush13}" />
  28. </Style>
  29. <!-- 买卖价格 -->
  30. <DataTemplate x:Key="BidDataTemplate">
  31. <ContentControl x:Name="DataBorder" Padding="0,5">
  32. <Grid>
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="30" />
  35. <ColumnDefinition Width="2*" />
  36. <ColumnDefinition Width="*" />
  37. </Grid.ColumnDefinitions>
  38. <TextBlock FontWeight="Bold"><Run Text="{x:Static resources:Muchinfo_Resource.Trade_Buy}" /><Run Text="{Binding IndexChinese, Mode=OneWay}" />
  39. </TextBlock>
  40. <TextBlock Grid.Column="1"
  41. Margin="5,0"
  42. HorizontalAlignment="Right"
  43. FontWeight="Bold"
  44. Text="{Binding DisplayPrice,
  45. Mode=OneWay}" />
  46. <TextBlock Grid.Column="2"
  47. Margin="5,0"
  48. HorizontalAlignment="Right"
  49. FontWeight="Bold"
  50. Text="{Binding DisplayVolume,
  51. Mode=OneWay}" />
  52. </Grid>
  53. </ContentControl>
  54. <DataTemplate.Triggers>
  55. <DataTrigger Binding="{Binding PriceStatus}" Value="up">
  56. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush71}" />
  57. </DataTrigger>
  58. <DataTrigger Binding="{Binding PriceStatus}" Value="down">
  59. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush72}" />
  60. </DataTrigger>
  61. <DataTrigger Binding="{Binding PriceStatus}" Value="equal">
  62. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush10}" />
  63. </DataTrigger>
  64. </DataTemplate.Triggers>
  65. </DataTemplate>
  66. <!-- 买卖价格 -->
  67. <DataTemplate x:Key="AskDataTemplate">
  68. <ContentControl x:Name="DataBorder" Padding="0,5">
  69. <Grid>
  70. <Grid.ColumnDefinitions>
  71. <ColumnDefinition Width="30" />
  72. <ColumnDefinition Width="2*" />
  73. <ColumnDefinition Width="*" />
  74. </Grid.ColumnDefinitions>
  75. <TextBlock FontWeight="Bold"><Run Text="{x:Static resources:Muchinfo_Resource.Trade_Sell}" /><Run Text="{Binding IndexChinese, Mode=OneWay}" />
  76. </TextBlock>
  77. <TextBlock Grid.Column="1"
  78. Margin="5,0"
  79. HorizontalAlignment="Right"
  80. FontWeight="Bold"><Run Text="{Binding DisplayPrice, Mode=OneWay}" />
  81. </TextBlock>
  82. <TextBlock Grid.Column="2"
  83. Margin="5,0"
  84. HorizontalAlignment="Right"
  85. FontWeight="Bold"><Run Text="{Binding DisplayVolume, Mode=OneWay}" />
  86. </TextBlock>
  87. </Grid>
  88. </ContentControl>
  89. <DataTemplate.Triggers>
  90. <DataTrigger Binding="{Binding PriceStatus}" Value="up">
  91. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush71}" />
  92. </DataTrigger>
  93. <DataTrigger Binding="{Binding PriceStatus}" Value="down">
  94. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush72}" />
  95. </DataTrigger>
  96. <DataTrigger Binding="{Binding PriceStatus}" Value="equal">
  97. <Setter TargetName="DataBorder" Property="Foreground" Value="{DynamicResource MuchinfoBrush10}" />
  98. </DataTrigger>
  99. </DataTemplate.Triggers>
  100. </DataTemplate>
  101. </windows:WindowBase.Resources>
  102. <xctk:BusyIndicator BusyContent="{x:Static resources:Muchinfo_Resource.Busy_Summit_Wait}"
  103. Foreground="Black"
  104. IsBusy="{Binding IsBusy,
  105. Mode=TwoWay}">
  106. <Grid Margin="28,20,0,12">
  107. <Grid.ColumnDefinitions>
  108. <ColumnDefinition Width="65" />
  109. <ColumnDefinition Width="158" />
  110. <ColumnDefinition />
  111. </Grid.ColumnDefinitions>
  112. <Grid.RowDefinitions>
  113. <RowDefinition Height="Auto" />
  114. <RowDefinition Height="12" />
  115. <RowDefinition Height="Auto" />
  116. <RowDefinition Height="20" />
  117. <RowDefinition />
  118. <RowDefinition Height="60" />
  119. <RowDefinition Height="40" />
  120. </Grid.RowDefinitions>
  121. <TextBlock Text="{x:Static resources:Muchinfo_Resource.Trade_Xaml_Accout_Title}" />
  122. <TextBlock Grid.Column="1"
  123. Margin="8,0,0,0"
  124. HorizontalAlignment="Left"
  125. Text="{Binding AccountId}" />
  126. <TextBlock Grid.Row="2" Text="{x:Static resources:Muchinfo_Resource.Trade_Xaml_Goods_Title}" />
  127. <ComboBox Grid.Row="2"
  128. Grid.Column="1"
  129. Margin="8,0,0,0"
  130. DisplayMemberPath="Name"
  131. IsEnabled="{Binding IsGoodsSelect,
  132. Mode=TwoWay}"
  133. ItemsSource="{Binding CloseGoodses}"
  134. SelectedItem="{Binding CurrentGoods,
  135. Mode=TwoWay}"
  136. Style="{DynamicResource SimpleComboBoxStyle}" />
  137. <views:BidMarketClose Grid.Row="4"
  138. Grid.ColumnSpan="3"
  139. DataContext="{Binding CloseOrderBase}"
  140. Visibility="{Binding IsBidMarket,
  141. Converter={StaticResource BooleanToVisibility}}" />
  142. <views:MakeMarketClose Grid.Row="4"
  143. Grid.ColumnSpan="3"
  144. DataContext="{Binding CloseOrderBase}"
  145. Visibility="{Binding IsBidMarket,
  146. Converter={StaticResource BoolOpposedVisibility}}" />
  147. <Image Grid.Row="5"
  148. Grid.ColumnSpan="3"
  149. Height="60"
  150. Margin="0,0,20,2"
  151. Source="{Binding ImageSource}"
  152. Stretch="Uniform"
  153. Visibility="{Binding ImageVisibility}" />
  154. <Border Grid.Row="7"
  155. Grid.ColumnSpan="3"
  156. Margin="0,0,20,0"
  157. VerticalAlignment="Top"
  158. BorderBrush="{DynamicResource MuchinfoBrush6}"
  159. BorderThickness="1" />
  160. <StackPanel Grid.Row="7"
  161. Grid.ColumnSpan="3"
  162. Margin="80,0,0,0"
  163. Orientation="Horizontal">
  164. <Button Width="82"
  165. Height="26"
  166. Command="{Binding OKCommand}"
  167. CommandParameter="{Binding ElementName=CloseWindowBase}"
  168. Content="{x:Static resources:Muchinfo_Resource.Button_Confirm}"
  169. Style="{DynamicResource CommonButtonStyle}" />
  170. <Button Width="82"
  171. Height="26"
  172. Margin="60,0"
  173. Command="{Binding CancelCommand}"
  174. CommandParameter="{Binding ElementName=CloseWindowBase}"
  175. Content="{x:Static resources:Muchinfo_Resource.Button_Cancel}"
  176. IsCancel="True"
  177. Style="{DynamicResource CommonButtonStyle}" />
  178. </StackPanel>
  179. <!-- 报价牌 -->
  180. <Border Grid.RowSpan="5"
  181. Grid.Column="2"
  182. Margin="48,20,20,0"
  183. VerticalAlignment="Top"
  184. Background="{DynamicResource MuchinfoBrush23}"
  185. BorderBrush="{DynamicResource MuchinfoBrush24}"
  186. BorderThickness="1"
  187. CornerRadius="4"
  188. DataContext="{Binding CloseOrderBase}"
  189. Visibility="{Binding IsBidMarket,
  190. Converter={StaticResource BoolOpposedVisibility}}">
  191. <Grid>
  192. <Grid.RowDefinitions>
  193. <RowDefinition />
  194. <RowDefinition Height="Auto" />
  195. <RowDefinition />
  196. <RowDefinition Height="Auto" />
  197. <RowDefinition />
  198. </Grid.RowDefinitions>
  199. <StackPanel Height="44" Orientation="Horizontal">
  200. <TextBlock Margin="8,0,16,0"
  201. FontSize="20"
  202. Text="{x:Static resources:Muchinfo_Resource.Trade_Content_PurchasePrice}" />
  203. <zoom:ZoomFontText VerticalAlignment="Center"
  204. VerticalContentAlignment="Center"
  205. FontCount="{Binding Figures}"
  206. FontSize="20"
  207. FontWeight="Bold"
  208. Foreground="{DynamicResource MuchinfoBrush71}"
  209. Text="{Binding CurrentGoods.BidPriceDisplay}"
  210. ZoomFontSize="16" />
  211. </StackPanel>
  212. <Border Grid.Row="1"
  213. BorderBrush="{DynamicResource MuchinfoBrush25}"
  214. BorderThickness="1" />
  215. <StackPanel Grid.Row="2"
  216. Height="44"
  217. Orientation="Horizontal">
  218. <TextBlock Margin="8,0,16,0"
  219. FontSize="20"
  220. Text="{x:Static resources:Muchinfo_Resource.Trade_Content_SellPrice}" />
  221. <zoom:ZoomFontText VerticalAlignment="Center"
  222. VerticalContentAlignment="Center"
  223. FontCount="{Binding Figures}"
  224. FontSize="20"
  225. FontWeight="Bold"
  226. Foreground="{DynamicResource MuchinfoBrush72}"
  227. Text="{Binding CurrentGoods.AskPriceDisplay}"
  228. ZoomFontSize="16" />
  229. </StackPanel>
  230. </Grid>
  231. </Border>
  232. <!-- 五档报价 -->
  233. <Border Grid.RowSpan="5"
  234. Grid.Column="2"
  235. Height="300"
  236. Margin="46,0,0,0"
  237. VerticalAlignment="Top"
  238. BorderBrush="{DynamicResource MuchinfoBrush6}"
  239. BorderThickness="2,0,0,0"
  240. DataContext="{Binding CloseOrderBase}"
  241. IsHitTestVisible="False"
  242. Visibility="{Binding IsBidMarket,
  243. Converter={StaticResource BooleanToVisibility}}">
  244. <Grid>
  245. <Grid.RowDefinitions>
  246. <RowDefinition />
  247. <RowDefinition Height="Auto" />
  248. <RowDefinition />
  249. <RowDefinition Height="Auto" />
  250. </Grid.RowDefinitions>
  251. <ListBox Margin="10,0,10,10"
  252. VerticalAlignment="Bottom"
  253. Background="Transparent"
  254. BorderBrush="Transparent"
  255. ItemContainerStyle="{DynamicResource BidPriceListBoxItem}"
  256. ItemTemplate="{StaticResource AskDataTemplate}"
  257. ItemsSource="{Binding AskCommissions}"
  258. Style="{DynamicResource BidPriceListBox}" />
  259. <Separator Grid.Row="1"
  260. Margin="10,0"
  261. BorderBrush="{DynamicResource MuchinfoBrush6}"
  262. Style="{DynamicResource ThinSeparatorStyle}" />
  263. <ListBox Grid.Row="2"
  264. Margin="10,10,10,0"
  265. VerticalAlignment="Top"
  266. Background="Transparent"
  267. BorderBrush="Transparent"
  268. ItemContainerStyle="{DynamicResource BidPriceListBoxItem}"
  269. ItemTemplate="{StaticResource BidDataTemplate}"
  270. ItemsSource="{Binding BidCommissions}"
  271. Style="{DynamicResource BidPriceListBox}" />
  272. <StackPanel Grid.Row="3"
  273. Margin="10,10"
  274. HorizontalAlignment="Left"
  275. Orientation="Vertical">
  276. <TextBlock FontWeight="Bold"
  277. Foreground="{DynamicResource MuchinfoBrush18}"
  278. Visibility="{Binding UpPriceVisibility}">
  279. <Run Text="{x:Static resources:Muchinfo_Resource.Trade_BidIncrement_Title}" />
  280. <Run Text="{Binding UpPriceDisplay, Mode=OneWay}" />
  281. </TextBlock>
  282. <TextBlock Margin="0,5,0,0"
  283. FontWeight="Bold"
  284. Foreground="{DynamicResource MuchinfoBrush27}"
  285. Visibility="{Binding FallPriceVisibility}">
  286. <Run Text="{x:Static resources:Muchinfo_Resource.Trade_BidBlow_Title}" />
  287. <Run Text="{Binding LowPriceDisplay, Mode=OneWay}" />
  288. </TextBlock>
  289. </StackPanel>
  290. </Grid>
  291. </Border>
  292. <!-- 验证数据 -->
  293. <TextBlock Grid.Row="3"
  294. Grid.Column="1"
  295. Grid.ColumnSpan="2"
  296. Margin="8,0,0,0"
  297. HorizontalAlignment="Left"
  298. Foreground="{DynamicResource MuchinfoBrush26}"
  299. Text="{Binding GoodsVailedString}" />
  300. </Grid>
  301. </xctk:BusyIndicator>
  302. </windows:WindowBase>