| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- <UserControl x:Class="Muchinfo.MTPClient.Quotation.Views.QuoteBoardView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:border="clr-namespace:Muchinfo.WPF.Controls.Border;assembly=Client.WPF.Controls"
- xmlns:controls="clr-namespace:Muchinfo.WPF.Controls;assembly=Client.WPF.Controls"
- xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:dataGrid="clr-namespace:Muchinfo.WPF.Controls.DataGrid;assembly=Client.WPF.Controls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
- xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
- x:Name="view"
- d:DesignHeight="300"
- d:DesignWidth="300"
- mc:Ignorable="d">
- <UserControl.Resources>
- <converters:IncreaseValueToVisibilityConverter x:Key="increaseValueToVisibilityConverter" />
- <converters:TradeModeVisibilityConverter x:Key="tradeModeVisibilityConverter" />
- <converters:FontSizeByLengthConverter x:Key="fontSizeByLengthConverter" />
- <converters:EnumVisibilityConvert x:Key="EnumVisibilityConvert" />
- <BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
- <Style x:Key="BoardListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
- <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
- <Setter Property="Padding" Value="2" />
- <Setter Property="Margin" Value="2" />
- <Setter Property="FontSize" Value="{DynamicResource MuchinfoFontSize_S}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd"
- Width="256"
- Height="150"
- BorderBrush="{DynamicResource MuchinfoBrush114}"
- BorderThickness="1"
- CornerRadius="0"
- Padding="{TemplateBinding Padding}"
- SnapsToDevicePixels="true">
- <!-- 使用Effect后在Windows XP上显示不了背景 -->
- <!--
- <Border.Effect>
- <DropShadowEffect BlurRadius="10" ShadowDepth="0" />
- </Border.Effect>
- -->
- <Border.Background>
- <ImageBrush ImageSource="{DynamicResource QuoteBoardBackgroundImageSource}" />
- </Border.Background>
- <Grid Width="252" Height="150">
- <Grid.ColumnDefinitions>
- <ColumnDefinition SharedSizeGroup="SingleWidthColumn" />
- </Grid.ColumnDefinitions>
- <Grid.Style>
- <Style>
- <Setter Property="TextBlock.Foreground" Value="Transparent" />
- </Style>
- </Grid.Style>
- <Canvas Width="252" Height="150">
- <!-- Region 第一行:商品名+时间 -->
- <Grid Width="245"
- Margin="3,2,2,0"
- HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Column="0"
- VerticalAlignment="Center"
- FontWeight="Bold"
- Foreground="{DynamicResource NameDefaultBrush}"
- Text="{Binding CodeNameDisplay}"
- TextTrimming="CharacterEllipsis"
- TextWrapping="NoWrap"
- ToolTip="{Binding CodeNameDisplay}" />
- <TextBlock Grid.Column="1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush112}"
- Text="{Binding DateDisplay}"
- TextTrimming="CharacterEllipsis"
- ToolTip="{Binding DateDisplay}" />
- </Grid>
- <!-- EndRegion -->
- <!-- Region 第二行:开、高、低、收 -->
- <Grid Canvas.Left="2"
- Canvas.Top="25"
- Width="245"
- Height="42"
- HorizontalAlignment="Stretch">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="2" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Row="0"
- Grid.Column="0"
- Margin="1,1"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush113}"
- Text="{x:Static resource:Client_Resource.QuoteBoard_Open}" />
- <TextBlock Grid.Row="0"
- Grid.Column="1"
- Margin="1,1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{Binding OpenColor}"
- Text="{Binding OpenDisplay}" />
- <Border Grid.Row="0"
- Grid.Column="2"
- Width="55"
- Height="16"
- Margin="1,1"
- VerticalAlignment="Center"
- Background="{DynamicResource MuchinfoBrush115}"
- BorderThickness="0"
- CornerRadius="2"
- Padding="2,0">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{Binding IncreaseValueColor}"
- Text="{Binding IncreaseValueDisplay}"
- ToolTip="{Binding IncreaseValueDisplay}" />
- </Border>
- <TextBlock Grid.Row="0"
- Grid.Column="3"
- Margin="1,1"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush113}"
- Text="{x:Static resource:Client_Resource.QuoteBoard_Close}" />
- <TextBlock Grid.Row="0"
- Grid.Column="4"
- Margin="1,1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush113}"
- Text="{Binding LastCloseDisplay}" />
- <TextBlock Grid.Row="2"
- Grid.Column="0"
- Margin="1,1"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush113}"
- Text="{x:Static resource:Client_Resource.QuoteBoard_Low}" />
- <TextBlock Grid.Row="2"
- Grid.Column="1"
- Margin="1,1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{Binding LowColor}"
- Text="{Binding LowDisplay}" />
- <Border Grid.Row="2"
- Grid.Column="2"
- Width="55"
- Height="16"
- Margin="1,1"
- VerticalAlignment="Center"
- Background="{DynamicResource MuchinfoBrush115}"
- BorderThickness="0"
- CornerRadius="2">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{Binding IncreasePercentColor}"
- Text="{Binding IncreasePercentDisplay}"
- ToolTip="{Binding IncreasePercentDisplay}" />
- </Border>
- <TextBlock Grid.Row="2"
- Grid.Column="3"
- Margin="1,1"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush113}"
- Text="{x:Static resource:Client_Resource.QuoteBoard_High}" />
- <TextBlock Grid.Row="2"
- Grid.Column="4"
- Margin="1,1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Foreground="{Binding HighColor}"
- Text="{Binding HighDisplay}" />
- </Grid>
- <!-- EndRegion -->
- <!-- Region 第三行:买卖价(OTC + 竞价) -->
- <Grid Canvas.Left="5"
- Canvas.Top="74"
- Width="240"
- Height="35"
- HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="1">
- <Path x:Name="UpArrow"
- Width="16"
- Height="20"
- Margin="0,-4,0,0"
- Data="F1M10.895,18.001C10.895,18.001 10.895,9.61 10.895,9.61 10.895,9.61 14.001,9.61 14.001,9.61 14.001,9.61 8,1.998 8,1.998 8,1.998 1.999,9.61 1.999,9.61 1.999,9.61 5.105,9.61 5.105,9.61 5.105,9.61 5.105,18.001 5.105,18.001 5.105,18.001 10.895,18.001 10.895,18.001z"
- Fill="{DynamicResource MuchinfoBrush122}"
- RenderTransformOrigin="0.438,-2.803"
- Visibility="{Binding IncreaseValue,
- ConverterParameter=1,
- Converter={StaticResource increaseValueToVisibilityConverter}}" />
- <Path x:Name="DownArrow"
- Width="16"
- Height="20"
- Margin="0,-4,0,0"
- Data="F1M5.105,1.998C5.105,1.998 5.105,10.39 5.105,10.39 5.105,10.39 1.999,10.39 1.999,10.39 1.999,10.39 8,18.001 8,18.001 8,18.001 14.001,10.39 14.001,10.39 14.001,10.39 10.895,10.39 10.895,10.39 10.895,10.39 10.895,1.998 10.895,1.998 10.895,1.998 5.105,1.998 5.105,1.998z"
- Fill="{DynamicResource MuchinfoBrush123}"
- Visibility="{Binding IncreaseValue,
- ConverterParameter=2,
- Converter={StaticResource increaseValueToVisibilityConverter}}" />
- </Grid>
- <!-- Region OTC -->
- <border:ExpBorder Grid.Column="0"
- Width="100"
- BorderThickness="2"
- ChangeBrush="{Binding BidPriceColor}"
- IsBorderThickness="False"
- IsVauleChange="{Binding IsBidPriceBorder}"
- Visibility="{Binding TradeMode,
- ConverterParameter=0,
- Converter={StaticResource tradeModeVisibilityConverter}}">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{Binding BidPriceDisplay,
- Converter={StaticResource fontSizeByLengthConverter}}"
- FontWeight="Bold"
- Foreground="{Binding BidPriceColor}"
- IsHyphenationEnabled="True"
- LineStackingStrategy="BlockLineHeight"
- Text="{Binding BidPriceDisplay}"
- TextAlignment="Center"
- TextWrapping="Wrap"
- Visibility="{Binding TradeMode,
- ConverterParameter=0,
- Converter={StaticResource tradeModeVisibilityConverter}}" />
- </border:ExpBorder>
- <border:ExpBorder Grid.Column="2"
- Width="100"
- BorderThickness="2"
- ChangeBrush="{Binding AskPriceColor}"
- IsBorderThickness="False"
- IsVauleChange="{Binding IsAskPriceBorder}"
- Visibility="{Binding TradeMode,
- ConverterParameter=0,
- Converter={StaticResource tradeModeVisibilityConverter}}">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{Binding AskPriceDisplay,
- Converter={StaticResource fontSizeByLengthConverter}}"
- FontWeight="Bold"
- Foreground="{Binding AskPriceColor}"
- IsHyphenationEnabled="True"
- LineStackingStrategy="BlockLineHeight"
- Text="{Binding AskPriceDisplay}"
- TextAlignment="Center"
- TextWrapping="Wrap"
- Visibility="{Binding TradeMode,
- ConverterParameter=0,
- Converter={StaticResource tradeModeVisibilityConverter}}" />
- </border:ExpBorder>
- <!-- EndRegion -->
- <!-- Region IsBidMarket -->
- <border:ExpBorder Grid.Column="0"
- Width="100"
- BorderThickness="2"
- ChangeBrush="{Binding AskPriceColor}"
- IsBorderThickness="False"
- IsVauleChange="{Binding IsAskPriceBorder}"
- Visibility="{Binding TradeMode,
- ConverterParameter=1,
- Converter={StaticResource tradeModeVisibilityConverter}}">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{Binding AskPriceDisplay,
- Converter={StaticResource fontSizeByLengthConverter}}"
- FontWeight="Bold"
- Foreground="{Binding AskPriceColor}"
- IsHyphenationEnabled="True"
- LineStackingStrategy="BlockLineHeight"
- Text="{Binding AskPriceDisplay}"
- TextAlignment="Center"
- TextWrapping="Wrap"
- Visibility="{Binding TradeMode,
- ConverterParameter=1,
- Converter={StaticResource tradeModeVisibilityConverter}}" />
- </border:ExpBorder>
- <border:ExpBorder Grid.Column="2"
- Width="100"
- BorderThickness="2"
- ChangeBrush="{Binding BidPriceColor}"
- IsBorderThickness="False"
- IsVauleChange="{Binding IsBidPriceBorder}"
- Visibility="{Binding TradeMode,
- ConverterParameter=1,
- Converter={StaticResource tradeModeVisibilityConverter}}">
- <TextBlock HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{Binding BidPriceDisplay,
- Converter={StaticResource fontSizeByLengthConverter}}"
- FontWeight="Bold"
- Foreground="{Binding BidPriceColor}"
- IsHyphenationEnabled="True"
- LineStackingStrategy="BlockLineHeight"
- Text="{Binding BidPriceDisplay}"
- TextAlignment="Center"
- TextWrapping="Wrap"
- Visibility="{Binding TradeMode,
- ConverterParameter=1,
- Converter={StaticResource tradeModeVisibilityConverter}}" />
- </border:ExpBorder>
- <!-- EndRegion -->
- </Grid>
- <!-- EndRegion -->
- <!-- Region 第四行 买卖按钮 -->
- <Grid Canvas.Left="2"
- Canvas.Top="111"
- Width="250"
- Height="28"
- HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Button Grid.Column="0"
- Width="89"
- Height="26"
- Margin="2,0,0,0"
- Command="{Binding DataContext.BuyCommand,
- ElementName=view}"
- CommandParameter="{Binding}"
- Content="{x:Static resource:Client_Resource.Market_Open_bid}"
- Cursor="Hand"
- FontSize="12"
- IsEnabled="{Binding DataContext.IsBidEnable,
- ElementName=view}"
- Padding="10,3"
- Style="{StaticResource CommonButtonStyle}" />
- <controls:DecimalNumBox Grid.Column="1"
- Width="54"
- Height="24"
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- DecimalCount="4"
- DefaultValue="{Binding MinOpenNumber,
- Mode=OneTime}"
- DisplayDefaultValueOnEmptyText="True"
- Increment="{Binding MinOpenNumber}"
- Minimum="{Binding MinOpenNumber,
- Mode=OneWay}"
- Style="{DynamicResource DecimalUpDownStyle}"
- Value="{Binding Lot,
- Mode=TwoWay}" />
- <Button x:Name="SellButton"
- Grid.Column="2"
- Width="89"
- Height="26"
- Margin="1,0,2,0"
- Background="{DynamicResource QuoteBroadSellBrush}"
- Command="{Binding DataContext.SellCommand,
- ElementName=view}"
- CommandParameter="{Binding}"
- Content="{x:Static resource:Client_Resource.Market_Open_Ask}"
- Cursor="Hand"
- FontSize="12"
- IsEnabled="{Binding DataContext.IsAskEnable,
- ElementName=view}"
- Padding="10,3"
- Style="{StaticResource SellConentButtonStyle}" />
- </Grid>
- <!-- EndRegion -->
- </Canvas>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource MuchinfoBrush117}" />
- <!--
- <Setter TargetName="Bd" Property="BorderThickness" Value="2" />
- <Setter TargetName="UpArrow" Property="Margin" Value="-2,-5,0,0" />
- <Setter TargetName="DownArrow" Property="Margin" Value="-2,-4,0,0" />
- -->
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="2*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <ListBox x:Name="QuoteListBox"
- Margin="1"
- Background="{DynamicResource MuchinfoBrush118}"
- BorderThickness="0"
- Focusable="True"
- Grid.IsSharedSizeScope="True"
- ItemContainerStyle="{StaticResource BoardListBoxItemStyle}"
- ItemsSource="{Binding ItemsSource}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- SelectedIndex="0"
- SelectionMode="Single"
- SnapsToDevicePixels="True">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- <!--
- {Binding IsVisibilityGoodsOfPAndX,
- Converter={StaticResource ToVisibilityConverter}}
- -->
- <StackPanel Grid.Row="1"
- Height="Auto"
- Visibility="Collapsed">
- <StackPanel Visibility="{Binding RelationMode, Converter={StaticResource EnumVisibilityConvert}, ConverterParameter=0}">
- <TextBlock Margin="5,5,0,5"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Foreground="{StaticResource TextBrush_Common}"
- Text="{x:Static resource:Client_Resource.QuoteBoardView_DeliveryGoodsInfo_property_N}" />
- </StackPanel>
- <StackPanel Visibility="{Binding RelationMode, Converter={StaticResource EnumVisibilityConvert}, ConverterParameter=1}">
- <TextBlock Margin="5,5,0,5"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Foreground="{StaticResource TextBrush_Common}"
- Text="{x:Static resource:Client_Resource.QuoteBoardView_DeliveryGoodsInfo_property_P}" />
- <StackPanel Height="25" Background="{DynamicResource AcountGridHeadBackground}">
- <TextBlock Margin="10,5,0,0" Foreground="{DynamicResource AcountGridHeadForeground}">
- <Run Text="{x:Static resource:Client_Resource.DeliveryOrderView_DeliveryGoods}" />
- <Run Text=":" />
- <Run Text="{Binding PDeliveryGoodsName}" />
- </TextBlock>
- </StackPanel>
- </StackPanel>
- <StackPanel Visibility="{Binding RelationMode, Converter={StaticResource EnumVisibilityConvert}, ConverterParameter=2}">
- <TextBlock Margin="5,5,0,5"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Foreground="{StaticResource TextBrush_Common}"
- Text="{x:Static resource:Client_Resource.QuoteBoardView_DeliveryGoodsInfo_property_PX}" />
- <dataGrid:MuchinfoDataGrid x:Name="PAndXGoodsInfoDataGrid"
- GridLinesVisibility="None"
- ItemsSource="{Binding GoodsOfPandXInfoList}"
- ScrollViewer.HorizontalScrollBarVisibility="Auto"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- Style="{DynamicResource QuoteMuchinfoDataGridStyle}" />
- </StackPanel>
- </StackPanel>
- </Grid>
- </UserControl>
|