RiskControlView.xaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <windows:TradeAccountWindow x:Class="Muchinfo.MTPClient.Account.Views.RiskControlView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:convert="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
  5. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
  6. xmlns:windows="clr-namespace:Muchinfo.MTPClient.Infrastructure.Windows;assembly=Client.Infrastructure"
  7. Name="riskControl"
  8. Title="{Binding MessageTitle}"
  9. Width="250"
  10. Height="160"
  11. ShowInTaskbar="False"
  12. Style="{DynamicResource WindowBaseStyle}"
  13. Topmost="True">
  14. <Window.Resources>
  15. <convert:FontColorConvert x:Key="colorConvert" />
  16. <BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
  17. <Style TargetType="{x:Type TextBlock}">
  18. <Setter Property="Margin" Value="0,3" />
  19. <Setter Property="VerticalAlignment" Value="Center" />
  20. <Setter Property="Foreground" Value="{Binding RiskLevel, Converter={StaticResource colorConvert}}" />
  21. </Style>
  22. </Window.Resources>
  23. <windows:TradeAccountWindow.Triggers>
  24. <EventTrigger RoutedEvent="Window.Loaded">
  25. <BeginStoryboard>
  26. <Storyboard x:Name="Storyboard1">
  27. <DoubleAnimation Duration="0:0:3"
  28. From="0"
  29. Storyboard.TargetName="riskControl"
  30. Storyboard.TargetProperty="Opacity"
  31. To="1" />
  32. </Storyboard>
  33. </BeginStoryboard>
  34. </EventTrigger>
  35. </windows:TradeAccountWindow.Triggers>
  36. <Grid>
  37. <Grid Margin="5"
  38. Background="Transparent"
  39. MouseDown="Grid_MouseDown">
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="Auto" />
  42. <RowDefinition Height="Auto" />
  43. <RowDefinition Height="Auto" />
  44. <RowDefinition Height="Auto" />
  45. <RowDefinition Height="Auto" />
  46. </Grid.RowDefinitions>
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="auto" />
  49. <ColumnDefinition />
  50. </Grid.ColumnDefinitions>
  51. <TextBlock Grid.Row="0"
  52. Grid.Column="0"
  53. HorizontalAlignment="Left"
  54. Text="{x:Static resource:Client_Resource.Text_AccountName}" />
  55. <TextBlock Grid.Row="0"
  56. Grid.Column="1"
  57. HorizontalAlignment="Left"
  58. Text="{Binding LoginCode}" />
  59. <TextBlock Grid.Row="1"
  60. Grid.Column="0"
  61. HorizontalAlignment="Left"
  62. Text="{x:Static resource:Client_Resource.Text_SetRiskRate}" />
  63. <TextBlock Grid.Row="1"
  64. Grid.Column="1"
  65. HorizontalAlignment="Left">
  66. <Run Text="{Binding MsgRate}" />
  67. <Run>%</Run>
  68. </TextBlock>
  69. <TextBlock Grid.Row="2"
  70. Grid.Column="0"
  71. HorizontalAlignment="Left"
  72. Text="{x:Static resource:Client_Resource.Text_ActualRiskRate}" />
  73. <TextBlock Grid.Row="2"
  74. Grid.Column="1"
  75. HorizontalAlignment="Left">
  76. <Run Text="{Binding RealRate}" />
  77. <Run>%</Run>
  78. </TextBlock>
  79. <TextBlock Grid.Row="3"
  80. Grid.Column="0"
  81. HorizontalAlignment="Left"
  82. Text="{x:Static resource:Client_Resource.Text_RiskLevel}"
  83. Visibility="{Binding IsRiskLevelVisible,
  84. Converter={StaticResource ToVisibilityConverter}}" />
  85. <TextBlock Grid.Row="3"
  86. Grid.Column="1"
  87. HorizontalAlignment="Left"
  88. Text="{Binding RiskLevelString}"
  89. Visibility="{Binding IsRiskLevelVisible,
  90. Converter={StaticResource ToVisibilityConverter}}" />
  91. <TextBlock Grid.Row="4"
  92. Grid.Column="0"
  93. HorizontalAlignment="Left"
  94. Text="{x:Static resource:Client_Resource.Text_Date}" />
  95. <TextBlock Grid.Row="4"
  96. Grid.Column="1"
  97. HorizontalAlignment="Left"
  98. Text="{Binding Date}" />
  99. </Grid>
  100. </Grid>
  101. </windows:TradeAccountWindow>