| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <UserControl x:Class="Muchinfo.MTPClient.UI.Views.StatusBarControl"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
- DataContext="{Binding StatusBar,
- Source={StaticResource Locator}}"
- mc:Ignorable="d">
- <UserControl.Resources>
- <BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
- <converters:BoolOpposedVisibility x:Key="OpposedVisibility" />
- <Style x:Key="BarItemStyle" TargetType="{x:Type StatusBarItem}">
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="BorderThickness" Value="1,0" />
- </Style>
- <Style x:Key="StatusListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="2,0,0,0" />
- <Setter Property="BorderThickness" Value="0,0,1,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Padding="{TemplateBinding Padding}"
- SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- <Style x:Key="StatusListBoxStyle" TargetType="{x:Type ListBox}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <themes:ClassicBorderDecorator x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderStyle="Sunken"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ScrollViewer>
- </themes:ClassicBorderDecorator>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- -->
- <DataTemplate x:Key="StatusDataTemplate">
- <Grid Margin="10,0" Background="{DynamicResource MuchinfoBrush2}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="4*" />
- <ColumnDefinition Width="6*" />
- </Grid.ColumnDefinitions>
- <TextBlock HorizontalAlignment="Center"
- Foreground="{Binding IncreaseValueColor,
- Mode=OneWay}"
- Text="{Binding Name}" />
- <TextBlock Grid.Column="1"
- Margin="5,0"
- Foreground="{Binding IncreaseValueColor,
- Mode=OneWay}">
- <Run Text="{Binding CurrentPriceDisplay, Mode=OneWay}" />
- <Run Text="/" />
- <Run Text="{Binding IncreasePercentDisplay, Mode=OneWay}" />
- </TextBlock>
- </Grid>
- </DataTemplate>
- </UserControl.Resources>
- <Grid>
- <StatusBar Height="24" Background="{DynamicResource AccountInfoBackground}">
- <StatusBar.ItemsPanel>
- <ItemsPanelTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- </Grid>
- </ItemsPanelTemplate>
- </StatusBar.ItemsPanel>
- <StatusBarItem Grid.Column="0">
- <StackPanel Orientation="Horizontal" Visibility="{Binding IsAccountVisible, Converter={StaticResource BooleanToVisibility}}">
- <Image Width="12"
- Height="12"
- Margin="10,0,5,0"
- Source="{DynamicResource AccountIcon}" />
- <TextBlock VerticalAlignment="Center" Foreground="{DynamicResource AccountInfoForeground2}">
- <Run Text="{x:Static resource:Client_Resource.Moduel_AccountLogin}" />
- <Run Text="{Binding LoginID, Mode=OneWay}" />
- </TextBlock>
- <TextBlock Margin="20,0,0,0"
- VerticalAlignment="Center"
- Foreground="{DynamicResource AccountInfoForeground2}">
- <Run Text="{Binding CustomerName, Mode=OneWay}" />
- </TextBlock>
- <TextBlock Margin="20,0,0,0"
- VerticalAlignment="Center"
- Foreground="{DynamicResource AccountInfoForeground2}">
- <Run Text="{Binding AccountStatus, Mode=OneWay}" />
- </TextBlock>
- </StackPanel>
- </StatusBarItem>
- <!--
- <StatusBarItem MinWidth="50"
- Style="{DynamicResource BarItemStyle}"
- ToolTip="单击右键设置关注商品">
- <ListBox Name="FocusGoodsListBox"
- Cursor="Hand"
- ItemContainerStyle="{DynamicResource StatusListBoxItemStyle}"
- ItemTemplate="{DynamicResource StatusDataTemplate}"
- ItemsSource="{Binding IndicatorsGoodses}"
- SelectedItem="{Binding CurrentGoods,
- Mode=TwoWay}"
- Style="{DynamicResource StatusListBoxStyle}"
- ToolTip="单击左键查看关注商品分析表">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonUp">
- <i:InvokeCommandAction Command="{Binding FocusGoodsSelectedCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ListBox>
-
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseRightButtonUp">
- <i:InvokeCommandAction Command="{Binding FocusGoodsUpdateCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </StatusBarItem>
- <StatusBarItem Grid.Column="1" Style="{DynamicResource BarItemStyle}">
- <marQuees:CutOverControl Name="CutOverControl"
- DelayTime="00:00:05"
- Foreground="CornflowerBlue"
- ItemsSource="{Binding NewsTitleList}">
- <marQuees:CutOverControl.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Title}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonUp">
- <i:InvokeCommandAction Command="{Binding StatusBar.OpenNewsCommand, Source={StaticResource Locator}}" CommandParameter="{Binding NewsID}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </TextBlock>
- </DataTemplate>
- </marQuees:CutOverControl.ItemTemplate>
- </marQuees:CutOverControl>
- </StatusBarItem>
- <StatusBarItem Grid.Column="2" Padding="0" />
- -->
- <StatusBarItem Grid.Column="2">
- <TextBlock Foreground="{DynamicResource MainForegroundBrush}"><Run Text="{Binding ErrorMessage, Mode=OneWay}" /><Run Text=" " />
- </TextBlock>
- </StatusBarItem>
- <StatusBarItem Grid.Column="3"
- Margin="5,0"
- HorizontalContentAlignment="Right">
- <TextBlock Foreground="{DynamicResource MainForegroundBrush}"><Run Text="{Binding Version, Mode=OneWay}" />
- </TextBlock>
- </StatusBarItem>
- <StatusBarItem Grid.Column="4" Padding="0">
- <StackPanel Orientation="Horizontal">
- <!--
- <Image Width="24"
- Height="24"
- Margin="0,0,5,0"
- Source="{DynamicResource StatusbarWaring}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonUp">
- <i:InvokeCommandAction Command="{Binding StatusBar.OpenWarningCommand, Source={StaticResource Locator}}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Image>
- -->
- <!--
- <Image Width="20"
- Height="20"
- Source="{DynamicResource Status_alarmImage_p}"
- ToolTip="{Binding AlarmString}"
- Visibility="{Binding IsSyncVisible,
- Converter={StaticResource BooleanToVisibility}}" />
- -->
- <!--
- <Border Margin="0,0,20,2">
- <Image Width="20"
- Height="20"
- Source="{Binding NetStatusImageSource}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonUp">
- <i:InvokeCommandAction Command="{Binding StatusBar.OpenNetStatusCommand, Source={StaticResource Locator}}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Image>
-
- <Border.Style>
- <Style TargetType="Border">
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush10}" />
-
- </Trigger>
- </Style.Triggers>
- </Style>
- </Border.Style>
- </Border>
- -->
- <!--
- 交易连接 Visibility="{Binding TradeVisible,
- Converter={StaticResource BooleanToVisibility}}"
- -->
- <Grid Margin="5,0">
- <Image Width="20"
- Height="20"
- Source="{DynamicResource TradeConnectImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_TradeNormal}"
- Visibility="{Binding IsTradeConnect,
- Converter={StaticResource BooleanToVisibility}}" />
- <Image Width="20"
- Height="20"
- Source="{DynamicResource DisTradeConnectImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_TradeDisconnect}"
- Visibility="{Binding IsTradeConnect,
- Converter={StaticResource OpposedVisibility}}" />
- </Grid>
- <!--
- 交易行情连接 Visibility="{Binding TradeQuoteVisible,
- Converter={StaticResource BooleanToVisibility}}"
- -->
- <Grid Margin="5,0">
- <Image Width="20"
- Height="20"
- Source="{DynamicResource QuoteConnectImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_TradeQuoteNormal}"
- Visibility="{Binding IsQuoteConnect,
- Converter={StaticResource BooleanToVisibility}}" />
- <Image Width="20"
- Height="20"
- Source="{DynamicResource DisQuoteConnectCloseImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_TradeQuoteDisconnect}"
- Visibility="{Binding IsQuoteConnect,
- Converter={StaticResource OpposedVisibility}}" />
- </Grid>
- <!-- 游客行情连接 -->
- <Grid Margin="5,0" Visibility="{Binding GuestQuoteVisible, Converter={StaticResource BooleanToVisibility}}">
- <Image Width="20"
- Height="20"
- Source="{DynamicResource QuoteConnectImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_GuestQuoteNormal}"
- Visibility="{Binding IsGuestConnect,
- Converter={StaticResource BooleanToVisibility}}" />
- <Image Width="20"
- Height="20"
- Source="{DynamicResource DisQuoteConnectCloseImageSource}"
- ToolTip="{x:Static resource:Client_Resource.Text_State_GuestQuoteDisconnect}"
- Visibility="{Binding IsGuestConnect,
- Converter={StaticResource OpposedVisibility}}" />
- </Grid>
- </StackPanel>
- </StatusBarItem>
- <StatusBarItem Grid.Column="5">
- <!-- <Run Text="当前时间:" /> -->
- <TextBlock Foreground="{DynamicResource MainForegroundBrush}"><Run Text="{Binding CurrentTime}" />
- </TextBlock>
- </StatusBarItem>
- </StatusBar>
- </Grid>
- </UserControl>
|