TradeHeaderView.xaml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <UserControl x:Class="Muchinfo.MTPClient.Account.Views.TradeHeaderView"
  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=Client.Infrastructure"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
  8. xmlns:utilities="clr-namespace:Muchinfo.MTPClient.Account.Utilities"
  9. Margin="0,0"
  10. DataContext="{Binding TradeHeader,
  11. Source={StaticResource Locator}}"
  12. FontSize="{DynamicResource MuchinfoFontSize_S}"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
  16. <converters:BoolVisibilityExConverter x:Key="BoolOpposedVisibility" />
  17. <converters:BoolVisibilityConverter x:Key="BoolVisibilityConverter" />
  18. <DataTemplate x:Key="AccountFunstionStyle">
  19. <StackPanel Margin="20,6"
  20. VerticalAlignment="Center"
  21. Orientation="Horizontal "
  22. Visibility="{Binding CurrentTradeAccount.IsShowHeaderFundInfoEx,
  23. Converter={StaticResource BoolOpposedVisibility}}">
  24. <TextBlock>
  25. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_NetValue}" />
  26. <Run FontWeight="Bold"
  27. Foreground="{DynamicResource AccountTextForeground}"
  28. Text="{Binding CurrentNetWorthDisplay,
  29. Mode=OneWay}" />
  30. </TextBlock>
  31. <TextBlock Margin="20,0">
  32. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_CanUseMoney}" />
  33. <Run FontWeight="Bold"
  34. Foreground="{DynamicResource AccountTextForeground}"
  35. Text="{Binding AvailMarginDisplay,
  36. Mode=OneWay}" />
  37. </TextBlock>
  38. <TextBlock>
  39. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_OccupyCash}" />
  40. <Run FontWeight="Bold"
  41. Foreground="{DynamicResource AccountTextForeground}"
  42. Text="{Binding UsedMarginDisplay,
  43. Mode=OneWay}" />
  44. </TextBlock>
  45. <TextBlock Margin="20,0">
  46. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_Floating}" />
  47. <Run FontWeight="Bold"
  48. Foreground="{Binding FloatPLBrush,
  49. Mode=OneWay}"
  50. Text="{Binding FloatPL,
  51. Mode=OneWay}" />
  52. </TextBlock>
  53. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  54. <TextBlock>
  55. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Domain_RiskRatio}" />
  56. <Run FontWeight="Bold"
  57. Foreground="{DynamicResource AccountTextForeground}"
  58. Text="{Binding RiskRatioDisplay,
  59. Mode=OneWay}" />
  60. </TextBlock>
  61. </Grid>
  62. </StackPanel>
  63. </DataTemplate>
  64. </UserControl.Resources>
  65. <ScrollViewer HorizontalScrollBarVisibility="Auto"
  66. Style="{DynamicResource QuoteMarketStyle}"
  67. VerticalScrollBarVisibility="Hidden">
  68. <Grid Height="33" Background="{DynamicResource AccountInfoBackground}">
  69. <Grid.ColumnDefinitions>
  70. <ColumnDefinition Width="Auto" />
  71. <ColumnDefinition Width="Auto" />
  72. <ColumnDefinition />
  73. <ColumnDefinition Width="Auto" />
  74. </Grid.ColumnDefinitions>
  75. <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal">
  76. <StackPanel Orientation="Horizontal">
  77. <Button Width="28"
  78. Height="24"
  79. Margin="20,0,5,0"
  80. VerticalAlignment="Center"
  81. Command="{Binding BackCommand}"
  82. Style="{DynamicResource ImageButtonStyle}"
  83. ToolTip="{x:Static resource:Client_Resource.Tools_Text_Back}">
  84. <Image Source="{DynamicResource BackImageSource}" Stretch="Uniform" />
  85. </Button>
  86. <Button Width="28"
  87. Height="24"
  88. Margin="5,0"
  89. VerticalAlignment="Center"
  90. Command="{Binding RefreshCommand}"
  91. Style="{DynamicResource ImageButtonStyle}"
  92. ToolTip="{x:Static resource:Client_Resource.Tools_Text_Reflash}">
  93. <Image Source="{DynamicResource ReflashImageSource}" Stretch="Uniform" />
  94. </Button>
  95. <Button Width="28"
  96. Height="24"
  97. Margin="5,0"
  98. VerticalAlignment="Center"
  99. Command="{Binding TradeSetCommand}"
  100. Style="{DynamicResource ImageButtonStyle}"
  101. ToolTip="{x:Static resource:Client_Resource.Tools_Text_TradeSet}">
  102. <Image Source="{DynamicResource TradeSetImageSource}" Stretch="Uniform" />
  103. </Button>
  104. <CheckBox x:Name="CheckBox"
  105. Width="28"
  106. Height="24"
  107. Margin="5,0,0,0"
  108. VerticalContentAlignment="Center"
  109. IsChecked="{Binding IsTradeVisible}"
  110. Padding="0"
  111. Style="{DynamicResource AccountInfoCheckBoxStyle}"
  112. Visibility="{Binding IsAccountLogin,
  113. Converter={StaticResource ToVisibilityConverter}}">
  114. <Grid>
  115. <Image Source="{DynamicResource TradeHideImageSource}"
  116. Stretch="Uniform"
  117. ToolTip="{x:Static resource:Client_Resource.Tools_Text_HideTrade}"
  118. Visibility="{Binding IsChecked,
  119. Converter={StaticResource ToVisibilityConverter},
  120. ElementName=CheckBox}" />
  121. <Image Source="{DynamicResource TradeExpandImageSource}"
  122. Stretch="Uniform"
  123. ToolTip="{x:Static resource:Client_Resource.Tools_Text_ExpandTrade}"
  124. Visibility="{Binding IsChecked,
  125. Converter={StaticResource BoolOpposedVisibility},
  126. ElementName=CheckBox}" />
  127. </Grid>
  128. </CheckBox>
  129. </StackPanel>
  130. <Grid DataContext="{Binding CurrentTradeAccount}" Visibility="Collapsed">
  131. <Grid.ColumnDefinitions>
  132. <ColumnDefinition Width="Auto" />
  133. <ColumnDefinition Width="2*" />
  134. <ColumnDefinition Width="*" />
  135. <ColumnDefinition Width="Auto" />
  136. <!-- <ColumnDefinition Width="2*" /> -->
  137. </Grid.ColumnDefinitions>
  138. <Image Grid.Row="0"
  139. Width="12"
  140. Height="12"
  141. Margin="10,0,5,0"
  142. Source="{DynamicResource AccountIcon}" />
  143. <TextBlock Grid.Column="1"
  144. VerticalAlignment="Center"
  145. Foreground="{DynamicResource AccountInfoForeground2}">
  146. <Run Text="{x:Static resource:Client_Resource.Moduel_AccountLogin}" />
  147. <Run Text="{Binding LoginCode, Mode=OneWay}" />
  148. </TextBlock>
  149. <TextBlock Grid.Column="2"
  150. Margin="20,0,0,0"
  151. VerticalAlignment="Center"
  152. Foreground="{DynamicResource TextBlockForeground2}">
  153. <Run Text="{Binding CustomerName, Mode=OneWay}" />
  154. </TextBlock>
  155. <Separator Grid.Column="3"
  156. Width="1"
  157. Height="34"
  158. Margin="50,0,0,0"
  159. BorderBrush="{DynamicResource AccountInfoVerBorderBrush}"
  160. Style="{DynamicResource ThinSeparatorStyle}" />
  161. </Grid>
  162. <StackPanel Orientation="Horizontal" Visibility="{Binding MarkMenuTypeVisibility, Mode=TwoWay}">
  163. <Button x:Name="btn_BuyCommand"
  164. Width="70"
  165. Height="24"
  166. Margin="20,0,0,0"
  167. VerticalAlignment="Center"
  168. Command="{Binding BuyCommand}"
  169. Content="{x:Static resource:Client_Resource.Content_Purchase}"
  170. IsDefault="False"
  171. Style="{DynamicResource CommonButtonStyle}"
  172. Visibility="{Binding IsBidAskVbs,
  173. Converter={StaticResource BoolVisibilityConverter}}" />
  174. <Button x:Name="btn_SellCommand"
  175. Width="70"
  176. Height="24"
  177. Margin="10,0,0,0"
  178. VerticalAlignment="Center"
  179. Command="{Binding SellCommand}"
  180. Content="{x:Static resource:Client_Resource.Content_SellOut}"
  181. IsDefault="False"
  182. Style="{DynamicResource CommonButtonStyle}"
  183. Visibility="{Binding IsBidAskVbs,
  184. Converter={StaticResource BoolVisibilityConverter}}" />
  185. <Button Width="70"
  186. Height="24"
  187. Margin="10,0,0,0"
  188. VerticalAlignment="Center"
  189. Command="{Binding ListingCommand}"
  190. Content="{x:Static resource:Client_Resource.ListingMarket_Listing_btn}"
  191. IsDefault="False"
  192. Style="{DynamicResource CommonButtonStyle}"
  193. Visibility="{Binding IsShowListing,
  194. Converter={StaticResource BoolVisibilityConverter}}" />
  195. <Button Width="90"
  196. Height="24"
  197. Margin="10,0,0,0"
  198. VerticalAlignment="Center"
  199. Command="{Binding HoldCommand}"
  200. Content="{x:Static resource:Client_Resource.Button_HolderSummary}"
  201. Style="{DynamicResource CommonButtonStyle}" />
  202. <!--
  203. <Button Width="70"
  204. Height="24"
  205. Margin="10,0,0,0"
  206. VerticalAlignment="Center"
  207. Command="{Binding CancelCommand}"
  208. Content="{x:Static resource:Client_Resource.Button_Cancellation}"
  209. IsEnabled="{Binding IsCancelEnable}"
  210. Style="{DynamicResource CommonButtonStyle}" />
  211. -->
  212. </StackPanel>
  213. </StackPanel>
  214. <!-- 投资者信息 -->
  215. <StackPanel Grid.Column="2"
  216. Margin="20,6"
  217. HorizontalAlignment="Left"
  218. VerticalAlignment="Center"
  219. Orientation="Horizontal "
  220. Visibility="{Binding CurrentTradeAccount.IsShowHeaderFundInfo,
  221. Converter={StaticResource BoolOpposedVisibility}}">
  222. <!-- 登录账号 -->
  223. <TextBlock DataContext="{Binding CurrentTradeAccount}">
  224. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_LoginID}" />
  225. <Run FontWeight="Bold"
  226. Foreground="{DynamicResource AccountTextForeground}"
  227. Text="{Binding LoginID}" />
  228. </TextBlock>
  229. <!-- 净值 -->
  230. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  231. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_NetValue}" />
  232. <Run FontWeight="Bold"
  233. Foreground="{DynamicResource AccountTextForeground}"
  234. Text="{Binding SumCurrentNetWorthDisplay,
  235. Mode=OneWay}" />
  236. </TextBlock>
  237. <!-- 市值 -->
  238. <Grid Visibility="{Binding IsHiddenWithoutMagin, Converter={StaticResource ToVisibilityConverter}}">
  239. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  240. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Content_PayNetWorth}" />
  241. <Run FontWeight="Bold"
  242. Foreground="{DynamicResource AccountTextForeground}"
  243. Text="{Binding PayNetWorthDisplay,
  244. Mode=OneWay}" />
  245. </TextBlock>
  246. </Grid>
  247. <!--
  248. 期初权益
  249. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  250. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Account_Amount_Balance}" />
  251. <Run FontWeight="Bold"
  252. Foreground="{DynamicResource AccountTextForeground}"
  253. Text="{Binding BalanceDisplay,
  254. Mode=OneWay}" />
  255. </TextBlock>
  256. -->
  257. <!-- 可用资金 -->
  258. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  259. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_CanUseMoney}" />
  260. <Run FontWeight="Bold"
  261. Foreground="{DynamicResource AccountTextForeground}"
  262. Text="{Binding AvailMarginDisplay,
  263. Mode=OneWay}" />
  264. </TextBlock>
  265. <!-- 占用资金 -->
  266. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  267. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  268. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_OccupyCash}" />
  269. <Run FontWeight="Bold"
  270. Foreground="{DynamicResource AccountTextForeground}"
  271. Text="{Binding UsedMarginDisplay,
  272. Mode=OneWay}" />
  273. </TextBlock>
  274. </Grid>
  275. <!--
  276. 总冻结保证金=冻结资金
  277. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  278. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  279. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Content_FreezeMargin}" />
  280. <Run FontWeight="Bold"
  281. Foreground="{DynamicResource AccountTextForeground}"
  282. Text="{Binding SumFreezeMarginDisplay,
  283. Mode=OneWay}" />
  284. </TextBlock>
  285. </Grid>
  286. -->
  287. <!-- 浮动盈亏 -->
  288. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  289. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  290. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_Floating}" />
  291. <Run FontWeight="Bold"
  292. Foreground="{Binding FloatPLBrush,
  293. Mode=OneWay}"
  294. Text="{Binding FloatPLDisplay,
  295. Mode=OneWay}" />
  296. </TextBlock>
  297. </Grid>
  298. <!-- 平仓盈亏 -->
  299. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  300. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  301. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Report_ClosePL}" />
  302. <Run FontWeight="Bold"
  303. Foreground="{Binding ClosePLBrush,
  304. Mode=OneWay}"
  305. Text="{Binding ClosePLDisplay,
  306. Mode=OneWay}" />
  307. </TextBlock>
  308. </Grid>
  309. <!-- 币种 -->
  310. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  311. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_Currency}" />
  312. <Run FontWeight="Bold"
  313. Foreground="{DynamicResource AccountTextForeground}"
  314. Text="{Binding Currency,
  315. Mode=OneWay}" />
  316. </TextBlock>
  317. <!-- 风险率 -->
  318. <TextBlock Margin="10,0"
  319. DataContext="{Binding CurrentTradeAccount.CurrentFundsAccount}"
  320. Visibility="{Binding IsHiddenWithoutFullPay,
  321. Converter={StaticResource ToVisibilityConverter}}">
  322. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Domain_RiskRatio}" />
  323. <Run FontWeight="Bold"
  324. Foreground="{DynamicResource AccountTextForeground}"
  325. Text="{Binding RiskRatioDisplay,
  326. Mode=OneWay}" />
  327. </TextBlock>
  328. </StackPanel>
  329. <!--
  330. <StackPanel Grid.Column="2"
  331. Margin="20,6"
  332. VerticalAlignment="Center"
  333. Orientation="Horizontal "
  334. Visibility="{Binding CurrentTradeAccount.IsShowHeaderFundInfoEx,
  335. Converter={StaticResource BoolOpposedVisibility}}">
  336. <TextBlock DataContext="{Binding CurrentTradeAccount.MemberAccountInfo}">
  337. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_NetValue}" />
  338. <Run Foreground="{DynamicResource AccountTextForeground}" Text="{Binding NetWorthDisplay, Mode=OneWay}" />
  339. </TextBlock>
  340. -->
  341. <!--
  342. 期初权益
  343. <TextBlock Margin="10,0" DataContext="{Binding CurrentTradeAccount.FundsAccounts}">
  344. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Account_Amount_Balance}" />
  345. <Run Foreground="{DynamicResource AccountTextForeground}" Text="{Binding BalanceDisplay, Mode=OneWay}" />
  346. </TextBlock>
  347. -->
  348. <!--
  349. <TextBlock Margin="20,0" DataContext="{Binding CurrentTradeAccount.MemberAccountInfo}">
  350. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_CanUseMoney}" />
  351. <Run Foreground="{DynamicResource AccountTextForeground}" Text="{Binding AvailMarginDisplay, Mode=OneWay}" />
  352. </TextBlock>
  353. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  354. <TextBlock Margin="20,0" DataContext="{Binding CurrentTradeAccount.MemberAccountInfo}">
  355. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Moduel_OccupyCash}" />
  356. <Run Foreground="{DynamicResource AccountTextForeground}" Text="{Binding UsedMarginDisplay, Mode=OneWay}" />
  357. </TextBlock>
  358. </Grid>
  359. <Grid Visibility="{Binding IsHiddenWithoutFullPay, Converter={StaticResource ToVisibilityConverter}}">
  360. <TextBlock DataContext="{Binding CurrentTradeAccount.MemberAccountInfo}">
  361. <Run Foreground="{DynamicResource TextBlockForeground}" Text="{x:Static resource:Client_Resource.Domain_RiskRatio}" />
  362. <Run Foreground="{DynamicResource AccountTextForeground}" Text="{Binding RateDisplay, Mode=OneWay}" />
  363. </TextBlock>
  364. </Grid>
  365. </StackPanel>
  366. -->
  367. </Grid>
  368. </ScrollViewer>
  369. </UserControl>