QuickOrderBar.xaml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <UserControl x:Class="Muchinfo.MTPClient.Trade.Views.QuickOrderBar"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
  7. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  8. DataContext="{Binding OrderBar,
  9. Source={StaticResource Locator}}"
  10. mc:Ignorable="d">
  11. <UserControl.Resources>
  12. <BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
  13. </UserControl.Resources>
  14. <Border BorderBrush="{DynamicResource MuchinfoBrush67}" BorderThickness="0,0,0,2">
  15. <Grid>
  16. <StackPanel HorizontalAlignment="Stretch"
  17. Background="{DynamicResource MuchinfoBrush75}"
  18. Orientation="Horizontal"
  19. Visibility="{Binding RadioButtonVisibility,
  20. Mode=TwoWay}">
  21. <Border MinWidth="100" Margin="30,5,0,0">
  22. <TextBlock Height="24"
  23. HorizontalAlignment="Right"
  24. VerticalAlignment="Center"
  25. FontSize="16"
  26. Foreground="{DynamicResource MuchinfoBrush105}"
  27. IsEnabled="False"
  28. Text="{Binding CurrentGoods.Name}" />
  29. </Border>
  30. <TextBlock Margin="10,0"
  31. VerticalAlignment="Center"
  32. Foreground="{DynamicResource MuchinfoBrush105}"
  33. Text="{x:Static resource:Client_Resource.Open_Lots}" />
  34. <xctk:DecimalUpDown MinWidth="80"
  35. Margin="0,5"
  36. VerticalAlignment="Center"
  37. DefaultValue="1"
  38. DisplayDefaultValueOnEmptyText="True"
  39. KeyDown="DecimalUpDown_KeyDown"
  40. Minimum="{Binding MinOpenNumber,
  41. Mode=OneWay}"
  42. Style="{DynamicResource DecimalUpDownStyle}"
  43. TabIndex="5"
  44. Value="{Binding Lot,
  45. Mode=TwoWay}" />
  46. <TextBlock Margin="10,0"
  47. VerticalAlignment="Center"
  48. Foreground="{DynamicResource MuchinfoBrush105}">
  49. <Run Text="≤" />
  50. <Run Text="{Binding MaxLot}" />
  51. </TextBlock>
  52. <TextBlock HorizontalAlignment="Left"
  53. VerticalAlignment="Center"
  54. Foreground="{DynamicResource MuchinfoBrush26}"
  55. Text="{Binding ShowMessage}" />
  56. <Button Height="26"
  57. Command="{Binding BuyCommand}"
  58. Content="{x:Static resource:Client_Resource.Market_Open_bid}"
  59. IsEnabled="{Binding CanOpenMarket}"
  60. Style="{DynamicResource CommonButtonStyle}" />
  61. <Button Height="26"
  62. Margin="20,0"
  63. Command="{Binding SellCommand}"
  64. CommandParameter="{Binding ElementName=openOrderWindow}"
  65. Content="{x:Static resource:Client_Resource.Market_Open_Ask}"
  66. IsEnabled="{Binding CanOpenMarket}"
  67. Style="{DynamicResource CommonButtonStyle}" />
  68. <TextBlock VerticalAlignment="Center"
  69. Foreground="{DynamicResource MuchinfoBrush105}"
  70. Visibility="{Binding Market_AllownPubsVisiable}">
  71. <Run Text="{x:Static resource:Client_Resource.Market_AllownPubs}" />
  72. <Run Text="{Binding AllowTradeSubText, Mode=TwoWay}" />
  73. </TextBlock>
  74. </StackPanel>
  75. <Grid Background="#60FFF8DC" Visibility="{Binding IsOrderVisible, Converter={StaticResource ToVisibilityConverter}}">
  76. <TextBlock HorizontalAlignment="Center"
  77. VerticalAlignment="Center"
  78. Foreground="Black"
  79. Text="{Binding BusyTips}" />
  80. </Grid>
  81. </Grid>
  82. </Border>
  83. </UserControl>