| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="clr-namespace:Muchinfo.WPF.Controls.Button;assembly=Client.WPF.Controls"
- xmlns:converters="clr-namespace:Muchinfo.MTPClient.Converters;assembly=Client"
- xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
- xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Client.WPF.Controls"
- xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit">
- <Style x:Key="ButtonFocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Border>
- <Rectangle Margin="4"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource FocusBorderBrush}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="CheckContractsButtonStyle"
- BasedOn="{StaticResource CommonButtonStyle}"
- TargetType="Button">
- <Setter Property="Height" Value="22" />
- </Style>
- <Style x:Key="InvestmentProductButtonStyle"
- BasedOn="{StaticResource CommonButtonStyle}"
- TargetType="Button">
- <Setter Property="Height" Value="26" />
- </Style>
- <Style x:Key="CommonButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonForeBrush}" />
- <Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="15,0" />
- <Setter Property="Width" Value="70" />
- <Setter Property="Height" Value="24" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
- <Border x:Name="OutsideBorder"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="3"
- Padding="1"
- Visibility="Collapsed">
- <Rectangle Name="OutSideRectangle"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource FocusVisualBrush}"
- StrokeDashArray="1,2"
- StrokeThickness="1"
- Visibility="Collapsed" />
- </Border>
- <Border x:Name="InnerBorder"
- Margin="1"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="2"
- Visibility="Visible">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- RecognizesAccessKey="True" />
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDisEnableColor}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource ButtonDisEnableColor}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonDisEnableForeground}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True ">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Visible" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonPressBrush}" />
- <!-- <Setter TargetName="MainGrid" Property="Margin" Value="1" /> -->
- </Trigger>
- <Trigger Property="IsFocused" Value="True ">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Visible" />
- <Setter TargetName="OutSideRectangle" Property="Visibility" Value="Visible" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 大字报卖 -->
- <Style x:Key="SellConentButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonForeBrush}" />
- <Setter Property="Background" Value="{DynamicResource QuoteBroadSellBrush}" />
- <Setter Property="FocusVisualStyle" Value="{DynamicResource ButtonFocusVisual}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="20,5" />
- <Setter Property="Width" Value="70" />
- <Setter Property="Height" Value="24" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
- <Border x:Name="OutsideBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="2.75"
- Visibility="Collapsed" />
- <Border x:Name="InnerBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1.75"
- Visibility="Visible">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- RecognizesAccessKey="True" />
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonDisEnableColor}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource ButtonDisEnableColor}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonDisEnableForeground}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True ">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Visible" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource MuchinfoBrush122}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource MuchinfoBrush122}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource QuoteBroadSellBrush}" />
- <!-- <Setter TargetName="MainGrid" Property="Margin" Value="1" /> -->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ButtonWithBorderStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource ButtonWithBorderBorderBrush}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonWithBorderForeground}" />
- <Setter Property="Background" Value="{DynamicResource ButtonWithBorderBackground}" />
- <Setter Property="FocusVisualStyle" Value="{DynamicResource ButtonFocusVisual}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="5,2" />
- <Setter Property="FontSize" Value="12" />
- <Setter Property="FontFamily" Value="Simsun, Microsoft YaHei" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
- <Border x:Name="OutsideBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="2.75"
- Visibility="Collapsed" />
- <Border x:Name="InnerBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1.75"
- Visibility="Visible">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- RecognizesAccessKey="True" />
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonWithBorderDisabledBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonWithBorderDisabledForeground}" />
- <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource ButtonWithBorderDisabledBorderBrush}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True ">
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonWithBorderMouseOveredBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonWithBorderMouseOveredForeground}" />
- <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource ButtonWithBorderMouseOveredBorderBrush}" />
- </Trigger>
- <Trigger Property="IsFocused" Value="True ">
- <!--
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource ButtonWithBorderMouseOveredBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonWithBorderMouseOveredForeground}" />
- -->
- <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource ButtonWithBorderMouseOveredBorderBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 文本按钮 -->
- <Style x:Key="TextButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="20,5" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
- <Rectangle Name="OutSideBorder"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource FocusVisualBrush}"
- StrokeDashArray="1,2"
- StrokeThickness="1"
- Visibility="Collapsed" />
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- RecognizesAccessKey="True" />
- <Border x:Name="linkLine"
- Grid.ColumnSpan="2"
- Height="1 "
- VerticalAlignment="Bottom"
- BorderBrush="{TemplateBinding Foreground}"
- BorderThickness="1"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False" />
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="linkLine" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="MainGrid" Property="Margin" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ImageButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="MainGrid" SnapsToDevicePixels="False">
- <Rectangle Fill="{TemplateBinding Background}"
- Opacity="0.5"
- Stretch="Fill" />
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- RecognizesAccessKey="True" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False" />
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{DynamicResource ButtonWithBorderMouseOveredBackground}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="MainGrid" Property="Margin" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Simple ScrollViewer
- ScrollViewer 是 Grid 控件,该控件包含 ContentPresenter 以及 Horizontal 和 Vertical ScrollBar
- 它可供 ListBox、MenuItem、ComboBox 和 TreeView 使用
- -->
- <Style x:Key="SimpleScrollViewer"
- BasedOn="{x:Null}"
- TargetType="{x:Type ScrollViewer}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollViewer}">
- <Grid Background="{TemplateBinding Background}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <ScrollContentPresenter Grid.Row="0"
- Grid.Column="0"
- Margin="{TemplateBinding Padding}"
- CanContentScroll="{TemplateBinding CanContentScroll}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}" />
- <!-- ScrollBars 的可见性通过控件的实现来控制 -->
- <ScrollBar x:Name="PART_HorizontalScrollBar"
- Grid.Row="1"
- Grid.Column="0"
- Maximum="{TemplateBinding ScrollableWidth}"
- Minimum="0"
- Orientation="Horizontal"
- Style="{DynamicResource SimpleScrollBar}"
- ViewportSize="{TemplateBinding ViewportWidth}"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
- Value="{Binding HorizontalOffset,
- Mode=OneWay,
- RelativeSource={RelativeSource TemplatedParent}}" />
- <ScrollBar x:Name="PART_VerticalScrollBar"
- Grid.Row="0"
- Grid.Column="1"
- Maximum="{TemplateBinding ScrollableHeight}"
- Minimum="0"
- Orientation="Vertical"
- Style="{DynamicResource SimpleScrollBar}"
- ViewportSize="{TemplateBinding ViewportHeight}"
- Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{Binding VerticalOffset,
- Mode=OneWay,
- RelativeSource={RelativeSource TemplatedParent}}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ComboBoxToggleButton"
- BasedOn="{x:Null}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <Border x:Name="Rectangle"
- Grid.ColumnSpan="2"
- Width="Auto"
- Height="Auto"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <Border Grid.Column="0"
- Width="Auto"
- Height="Auto"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <Path x:Name="Arrow"
- Grid.Column="1"
- Width="12"
- Height="8"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M107.45833,12.625 L115.042,22.375 122.34343,12.46875"
- Stretch="Fill"
- Stroke="{TemplateBinding BorderBrush}"
- StrokeThickness="1" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource CheckedBrush}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource DisEnableBrush}" />
- <Setter TargetName="Rectangle" Property="BorderBrush" Value="{DynamicResource DisEnableBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="LeftToggleButtonStyel" TargetType="{x:Type ToggleButton}">
- <Setter Property="Foreground" Value="{DynamicResource MarketMenuItemBrush}" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Width="{TemplateBinding Width}"
- Height="18"
- MinWidth="{TemplateBinding MinWidth}"
- Margin="0,0,0,0"
- HorizontalAlignment="Left">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="7" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="3" />
- </Grid.ColumnDefinitions>
- <Path x:Name="rec1"
- Grid.Column="0"
- Data="M 0,0 L 18,7 L 18,0"
- Fill="{DynamicResource MarketBackground}"
- Stretch="Fill" />
- <StackPanel x:Name="stack1"
- Grid.Column="1"
- Background="{DynamicResource MarketBackground}"
- Orientation="Horizontal">
- <TextBlock x:Name="txt"
- Margin="5,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{TemplateBinding Foreground}"
- Text="{TemplateBinding Content}" />
- </StackPanel>
- <Path x:Name="rec2"
- Grid.Column="2"
- Data="M 0,0 L 3,7 L 0,18"
- Fill="{DynamicResource MarketBackground}"
- Stretch="Fill" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MouseOverBrush}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MarketCheckedBrush}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MarketCheckedBrush}" />
- <Setter TargetName="txt" Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MarketCheckedBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="NewVerTabStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Foreground" Value="{DynamicResource NewTabForeground}" />
- <Setter Property="Background" Value="{DynamicResource MarketBackground}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- Margin="0,0,0,2"
- HorizontalAlignment="Left">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <controls:ImageButton x:Name="ImgVer"
- Margin="0"
- HoverImageSource="{DynamicResource VerTab_Image_MouseOver}"
- ImageHeight="{TemplateBinding Height}"
- ImageStretch="Fill"
- ImageWidth="{TemplateBinding Width}"
- NormalImageSource="{DynamicResource VerTab_Image_Normal}"
- Padding="0" />
- <TextBlock x:Name="rec1"
- Width="{TemplateBinding Width}"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Foreground="{DynamicResource MuchinfoBrush11}"
- Padding="4,8"
- Text="{TemplateBinding Content}"
- TextWrapping="Wrap" />
- </Grid>
- <ControlTemplate.Triggers>
- <!--
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- <Condition Property="IsChecked" Value="False" />
- </MultiTrigger.Conditions>
- <Setter TargetName="rec1" Property="Foreground" Value="{DynamicResource MouseOverBrush}" />
- </MultiTrigger>
- -->
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="ImgVer" Property="NormalImageSource" Value="{DynamicResource VerTab_Image_MouseOver}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Foreground" Value="{DynamicResource NewTabSelectedForeground}" />
- <Setter TargetName="ImgVer" Property="NormalImageSource" Value="{DynamicResource VerTab_Image_Selected}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="NewHorTabStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Foreground" Value="{DynamicResource NewTabForeground}" />
- <Setter Property="Background" Value="{DynamicResource MarketBackground}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <!--
- <controls:ImageButton x:Name="ImgVer"
- HoverImageSource="{DynamicResource HorTab_Image_MouseOver}"
- ImageHeight="{TemplateBinding Height}"
- ImageWidth="{TemplateBinding Width}"
- NormalImageSource="{DynamicResource HorTab_Image_Normal}" />
- -->
- <Image x:Name="ImgVer"
- Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- Source="{DynamicResource HorTab_Image_Normal}" />
- <TextBlock x:Name="rec1"
- Width="{TemplateBinding Width}"
- HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
- VerticalAlignment="{TemplateBinding VerticalAlignment}"
- Foreground="{DynamicResource MuchinfoBrush11}"
- Padding="8,0"
- Text="{TemplateBinding Content}"
- TextAlignment="Center"
- TextTrimming="CharacterEllipsis"
- ToolTip="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <!--
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- <Condition Property="IsChecked" Value="False" />
- </MultiTrigger.Conditions>
- <Setter TargetName="rec1" Property="Foreground" Value="{DynamicResource MouseOverBrush}" />
- </MultiTrigger>
- -->
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="ImgVer" Property="Source" Value="{DynamicResource HorTab_Image_MouseOver}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Foreground" Value="{DynamicResource NewTabSelectedForeground}" />
- <Setter TargetName="ImgVer" Property="Source" Value="{DynamicResource HorTab_Image_Selected}" />
- <Setter Property="Panel.ZIndex" Value="20" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 窗口关闭按钮样式 -->
- <Style x:Key="DialogCloseButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Padding" Value="4" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Width" Value="20" />
- <Setter Property="Foreground" Value="{DynamicResource WindowCloseButtonBrush}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="ContentContainer"
- CornerRadius="2"
- Padding="{TemplateBinding Padding}">
- <Path Data="M0.5,0.5 L19.5,19.5 M19.5,0.5 L0.5,19.5"
- Stretch="Fill"
- Stroke="{TemplateBinding Foreground}"
- StrokeThickness="2" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource WindowCloseMouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource WindowCloseMouseOverBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="RightTextBlockStyle" TargetType="{x:Type TextBlock}">
- <Setter Property="TextAlignment" Value="Right" />
- <Setter Property="Margin" Value="0,0,3,0" />
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- </Style>
- <Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="VerticalAlignment" Value="Stretch" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="2,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Grid Background="{TemplateBinding Background}">
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <BooleanToVisibilityConverter x:Key="ToVisibilityConverter" />
- <Style x:Key="ButtonSpinnerStyle" TargetType="{x:Type xctk:ButtonSpinner}">
- <Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Focusable" Value="False" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="IsTabStop" Value="True" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type xctk:ButtonSpinner}">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="2"
- SnapsToDevicePixels="True">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="1" />
- <ColumnDefinition Width="12" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- Focusable="False"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <Border Grid.Column="1" Background="Transparent" />
- <Grid Grid.Column="2"
- Margin="1"
- HorizontalAlignment="Stretch"
- Visibility="{TemplateBinding ShowButtonSpinner,
- Converter={StaticResource ToVisibilityConverter}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="1" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <RepeatButton x:Name="PART_IncreaseButton"
- IsTabStop="{TemplateBinding IsTabStop}"
- Style="{DynamicResource RepeatButtonStyle}">
- <Grid>
- <Line Width="11"
- Margin="1"
- VerticalAlignment="Center"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource RepeaterContentBrush}"
- StrokeThickness="1"
- X1="0"
- X2="1"
- Y1="0"
- Y2="0" />
- <Line Height="11"
- Margin="1"
- HorizontalAlignment="Center"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource RepeaterContentBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="1" />
- </Grid>
- </RepeatButton>
- <Border Grid.Row="1"
- HorizontalAlignment="Stretch"
- Background="Transparent" />
- <RepeatButton x:Name="PART_DecreaseButton"
- Grid.Row="2"
- IsTabStop="{TemplateBinding IsTabStop}"
- Style="{DynamicResource RepeatButtonStyle}">
- <Line Width="11"
- Margin="1"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource RepeaterContentBrush}"
- StrokeThickness="1"
- X1="0"
- X2="1"
- Y1="0"
- Y2="0" />
- </RepeatButton>
- </Grid>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger SourceName="PART_IncreaseButton" Property="IsPressed" Value="True">
- <Setter TargetName="PART_IncreaseButton" Property="Background" Value="#FFBC9E62" />
- </Trigger>
- <Trigger SourceName="PART_DecreaseButton" Property="IsPressed" Value="True">
- <Setter TargetName="PART_DecreaseButton" Property="Background" Value="#FFBC9E62" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 设置数字控件中的样式 -->
- <Style x:Key="WatermarkTextBoxStyle" TargetType="{x:Type xctk:WatermarkTextBox}">
- <Setter Property="AllowDrop" Value="True" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
- <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
- <Setter Property="WatermarkTemplate">
- <Setter.Value>
- <DataTemplate>
- <ContentControl Content="{Binding}"
- Focusable="False"
- Foreground="{DynamicResource ContentForeGround}" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type xctk:WatermarkTextBox}">
- <Grid>
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1" />
- <Border x:Name="MouseOverVisual"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1"
- Opacity="0">
- <Border.BorderBrush>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0.05" Color="#FF5794BF" />
- <GradientStop Offset="0.07" Color="#FFB7D5EA" />
- <GradientStop Offset="1" Color="#FFC7E2F1" />
- </LinearGradientBrush>
- </Border.BorderBrush>
- </Border>
- <Border x:Name="FocusVisual"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1"
- Opacity="0">
- <Border.BorderBrush>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0.05" Color="#FF3D7BAD" />
- <GradientStop Offset="0.07" Color="#FFA4C9E3" />
- <GradientStop Offset="1" Color="#FFB7D9ED" />
- </LinearGradientBrush>
- </Border.BorderBrush>
- </Border>
- <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <ContentPresenter x:Name="PART_WatermarkHost"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Watermark}"
- ContentTemplate="{TemplateBinding WatermarkTemplate}"
- IsHitTestVisible="False"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsFocused" Value="False" />
- <Condition Property="Text" Value="" />
- </MultiTrigger.Conditions>
- <Setter TargetName="PART_WatermarkHost" Property="Visibility" Value="Visible" />
- </MultiTrigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="MouseOverVisual" Property="Opacity" Value="1" />
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
- <Setter TargetName="FocusVisual" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- tookit DecimalUpDown 样式 -->
- <Style x:Key="DecimalUpDownStyle" TargetType="{x:Type xctk:DecimalUpDown}">
- <Setter Property="Height" Value="24" />
- <Setter Property="Background" Value="{DynamicResource ContentBackground}" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="Foreground" Value="{DynamicResource ContentForeGround}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="ClipValueToMinMax" Value="True" />
- <Setter Property="HorizontalContentAlignment" Value="Right" />
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="TextAlignment" Value="Right" />
- <Setter Property="WatermarkTemplate">
- <Setter.Value>
- <DataTemplate>
- <ContentControl Margin="0,0,3,0"
- Content="{Binding}"
- Focusable="False"
- Foreground="{DynamicResource ContentForeGround}" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type xctk:DecimalUpDown}">
- <Grid>
- <xctk:ButtonSpinner x:Name="PART_Spinner"
- AllowSpin="{Binding AllowSpin,
- RelativeSource={RelativeSource TemplatedParent}}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- IsTabStop="False"
- ShowButtonSpinner="{Binding ShowButtonSpinner,
- RelativeSource={RelativeSource TemplatedParent}}"
- Style="{DynamicResource ButtonSpinnerStyle}">
- <xctk:WatermarkTextBox x:Name="PART_TextBox"
- MinWidth="20"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
- AcceptsReturn="False"
- AutoMoveFocus="{Binding AutoMoveFocus,
- RelativeSource={RelativeSource TemplatedParent}}"
- AutoSelectBehavior="{Binding AutoSelectBehavior,
- RelativeSource={RelativeSource TemplatedParent}}"
- Background="Transparent"
- BorderBrush="Transparent"
- BorderThickness="0"
- ContextMenu="{TemplateBinding ContextMenu}"
- FontFamily="{TemplateBinding FontFamily}"
- FontSize="{TemplateBinding FontSize}"
- FontStretch="{TemplateBinding FontStretch}"
- FontStyle="{TemplateBinding FontStyle}"
- FontWeight="{TemplateBinding FontWeight}"
- Foreground="{TemplateBinding Foreground}"
- IsReadOnly="{Binding IsReadOnly,
- RelativeSource={RelativeSource TemplatedParent}}"
- Padding="{TemplateBinding Padding}"
- SelectAllOnGotFocus="{Binding SelectAllOnGotFocus,
- RelativeSource={RelativeSource TemplatedParent}}"
- Style="{StaticResource WatermarkTextBoxStyle}"
- TabIndex="{TemplateBinding TabIndex}"
- TextAlignment="{Binding TextAlignment,
- RelativeSource={RelativeSource TemplatedParent}}"
- TextWrapping="NoWrap"
- Watermark="{Binding Watermark,
- RelativeSource={RelativeSource TemplatedParent}}"
- WatermarkTemplate="{Binding WatermarkTemplate,
- RelativeSource={RelativeSource TemplatedParent}}" />
- </xctk:ButtonSpinner>
- <Rectangle x:Name="enableRectangle"
- Grid.ColumnSpan="3"
- Fill="{DynamicResource DisEnableBrush}"
- Opacity="0.7"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <!-- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> -->
- <Setter TargetName="enableRectangle" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
- <Setter TargetName="PART_TextBox" Property="FocusManager.FocusedElement" Value="{Binding ElementName=PART_TextBox}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 竞价使用样式 -->
- <Style x:Key="BidPriceListBox" TargetType="{x:Type ListBox}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <Grid>
- <Border x:Name="Border"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <ScrollViewer Margin="1"
- Background="{TemplateBinding Background}"
- Focusable="false"
- HorizontalScrollBarVisibility="Disabled"
- VerticalScrollBarVisibility="Disabled">
- <!-- StackPanel 用来显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="true" />
- </ScrollViewer>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- Simple ListBoxItem - 它用于 ListBox 中的每个项。该项的内容置于 ContentPresenter 中 -->
- <Style x:Key="BidPriceListBoxItem" TargetType="ListBoxItem">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Margin" Value="2,0" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Grid SnapsToDevicePixels="False">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="QuoteBidListBoxItem" TargetType="ListBoxItem">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Margin" Value="2,0" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Grid SnapsToDevicePixels="False">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{DynamicResource DataGridSelectBack}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="TikPriceListBoxItem" TargetType="ListBoxItem">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Margin" Value="2,1" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Grid SnapsToDevicePixels="true">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Visibility="Collapsed" />
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="Border" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 分笔使用样式 -->
- <Style x:Key="TikListBoxStyle" TargetType="{x:Type ListBox}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Margin" Value="0,2,0,0" />
- <Setter Property="ItemContainerStyle" Value="{DynamicResource TikPriceListBoxItem}" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
- <Border x:Name="Border"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <!-- StackPanel 用来显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel Margin="2" IsItemsHost="true" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 分笔详细使用样式 -->
- <Style x:Key="TikListDetailBoxStyle" TargetType="{x:Type ListBox}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Margin" Value="0,2,0,0" />
- <Setter Property="ItemContainerStyle" Value="{DynamicResource TikPriceListBoxItem}" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
- <Border x:Name="Border"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <!-- StackPanel 用来显示子级,方法是将 IsItemsHost 设置为 True -->
- <WrapPanel Margin="2"
- IsItemsHost="true"
- Orientation="Vertical" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 此 BitmapEffect 供 Simple MenuItem 使用 -->
- <DropShadowBitmapEffect x:Key="PopupDropShadow"
- ShadowDepth="1.5"
- Softness="0.15" />
- <!-- Simple MenuItem x:Key="SimpleMenuItem" - 该模板使用触发器来提供四种不同的菜单项排列方式,这些排列方式是通过 Role 属性设置的 -->
- <Style x:Key="CommonMenuItem" TargetType="{x:Type MenuItem}">
- <Setter Property="MinWidth" Value="40" />
- <Setter Property="FontSize" Value="15" />
- <Setter Property="Background" Value="{DynamicResource CommonBackgroundBrush}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Template" Value="{DynamicResource CommonMenuItemTemplate}" />
- </Style>
- <ControlTemplate x:Key="CommonMenuItemTemplate" TargetType="{x:Type MenuItem}">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <Grid>
- <!--
- Grid 用于结合 Icon、Content、Glyph 复选标记和 Arrow 的列,以显示下一个级别
- Grid 中采用大小共享方式,以便将每个 MenuItem 的 Icon、Content 和 Arrow 一起对齐
- -->
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"
- MinWidth="17"
- SharedSizeGroup="MenuItemIconColumnGroup" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
- <ColumnDefinition Width="14" />
- </Grid.ColumnDefinitions>
- <!-- ContentPresenter 用来显示 Icon (如果需要) -->
- <ContentPresenter x:Name="Icon"
- Margin="4,0,6,0"
- VerticalAlignment="Center"
- ContentSource="Icon" />
- <!-- Glyph 是一个复选标记(如果可选中的菜单需要) -->
- <Grid x:Name="GlyphPanel"
- Margin="4,0,6,0"
- VerticalAlignment="Center"
- Visibility="Hidden">
- <Path x:Name="GlyphPanelpath"
- VerticalAlignment="Center"
- Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z"
- Fill="{TemplateBinding Foreground}"
- FlowDirection="LeftToRight" />
- </Grid>
- <!-- 菜单文本等内容 -->
- <ContentPresenter x:Name="HeaderHost"
- Grid.Column="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- ContentSource="Header"
- RecognizesAccessKey="True" />
- <!-- 箭头绘制的路径,该路径指向菜单的下一个级别 -->
- <Grid x:Name="ArrowPanel"
- Grid.Column="3"
- Margin="4,0,6,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path x:Name="ArrowPanelPath"
- VerticalAlignment="Center"
- Data="M0,0 L0,8 L4,4 z"
- Fill="{DynamicResource CheckedBrush}" />
- </Grid>
- <!-- Popup 是向下展开或横向展开(具体取决于该项所处的级别)的菜单的主体 -->
- <Popup x:Name="SubMenuPopup"
- AllowsTransparency="true"
- Focusable="false"
- IsOpen="{Binding Path=IsSubmenuOpen,
- RelativeSource={RelativeSource TemplatedParent}}"
- Placement="Right"
- PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
- VerticalOffset="-3">
- <Grid x:Name="SubMenu">
- <!-- <Border x:Name="SubMenuBorder" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/> -->
- <!-- StackPanel 保留菜单的子级。这是通过 IsItemsHost=True 来设置的 -->
- <Border x:Name="SubMenuBorder"
- BorderBrush="{DynamicResource CommonBorderBrush}"
- BorderThickness="0">
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
- </Border>
- </Grid>
- </Popup>
- </Grid>
- </Border>
- <!-- 这些触发器通过 Role 重新配置 MenuItem 的四种排列方式以显示不同级别的菜单 -->
- <ControlTemplate.Triggers>
- <!-- Role = TopLevelHeader: 这是菜单中的根菜单项;Popup 向下展开 -->
- <Trigger Property="Role" Value="TopLevelHeader">
- <Setter Property="Margin" Value="0,1,0,1" />
- <Setter Property="Padding" Value="3" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Grid.IsSharedSizeScope" Value="true" />
- <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- Role = TopLevelItem: 这是没有任何子项的顶级菜单的子菜单项 -->
- <Trigger Property="Role" Value="TopLevelItem">
- <Setter Property="Margin" Value="0,1,0,1" />
- <Setter Property="Padding" Value="3" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- Role = SubMenuHeader: 这是不包含子级的子菜单项 -->
- <Trigger Property="Role" Value="SubmenuHeader">
- <Setter Property="DockPanel.Dock" Value="Top" />
- <Setter Property="Padding" Value="0,2,0,2" />
- <Setter Property="Grid.IsSharedSizeScope" Value="true" />
- </Trigger>
- <!-- Role = SubMenuItem: 这是包含子级的子菜单项 -->
- <Trigger Property="Role" Value="SubmenuItem">
- <Setter Property="DockPanel.Dock" Value="Top" />
- <Setter Property="Padding" Value="0,2,0,2" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsSuspendingPopupAnimation" Value="true">
- <Setter TargetName="SubMenuPopup" Property="PopupAnimation" Value="None" />
- </Trigger>
- <!-- 如果不存在 Icon,我们会折叠 Icon Content -->
- <Trigger Property="Icon" Value="{x:Null}">
- <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- GlyphPanel 包含 CheckMark -->
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
- <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource MenuMouseOverBackground}" />
- </Trigger>
- <Trigger SourceName="SubMenuPopup" Property="AllowsTransparency" Value="true">
- <Setter TargetName="SubMenu" Property="Margin" Value="0,0,3,3" />
- <Setter TargetName="SubMenu" Property="SnapsToDevicePixels" Value="true" />
- <Setter TargetName="SubMenuBorder" Property="BitmapEffect" Value="{DynamicResource PopupDropShadow}" />
- </Trigger>
- <!-- 对 Menu Highlight 和 IsEnabled 使用系统颜色 -->
- <Trigger Property="IsHighlighted" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource MenuMouseOverBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <!-- 上下文菜单样式 -->
- <Style x:Key="ContextCommonMenuItem" TargetType="{x:Type MenuItem}">
- <Setter Property="MinWidth" Value="70" />
- <Setter Property="FontSize" Value="15" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="BorderBrush" Value="{DynamicResource ContextSeparatorBrush}" />
- <Setter Property="BorderThickness" Value="0,0,0,1" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Template" Value="{DynamicResource ContextCommonMenuItemTemplate}" />
- </Style>
- <ControlTemplate x:Key="ContextCommonMenuItemTemplate" TargetType="{x:Type MenuItem}">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <Grid>
- <!--
- Grid 用于结合 Icon、Content、Glyph 复选标记和 Arrow 的列,以显示下一个级别
- Grid 中采用大小共享方式,以便将每个 MenuItem 的 Icon、Content 和 Arrow 一起对齐
- -->
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"
- MinWidth="17"
- SharedSizeGroup="MenuItemIconColumnGroup" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
- <ColumnDefinition Width="14" />
- </Grid.ColumnDefinitions>
- <!-- ContentPresenter 用来显示 Icon (如果需要) -->
- <ContentPresenter x:Name="Icon"
- Margin="4,0,6,0"
- VerticalAlignment="Center"
- ContentSource="Icon" />
- <!-- Glyph 是一个复选标记(如果可选中的菜单需要) -->
- <Grid x:Name="GlyphPanel"
- Margin="4,0,6,0"
- VerticalAlignment="Center"
- Visibility="Hidden">
- <Path x:Name="GlyphPanelpath"
- VerticalAlignment="Center"
- Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z"
- Fill="{TemplateBinding Foreground}"
- FlowDirection="LeftToRight" />
- </Grid>
- <!-- 菜单文本等内容 -->
- <ContentPresenter x:Name="HeaderHost"
- Grid.Column="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- ContentSource="Header"
- RecognizesAccessKey="True" />
- <!-- 箭头绘制的路径,该路径指向菜单的下一个级别 -->
- <Grid x:Name="ArrowPanel"
- Grid.Column="3"
- Margin="4,0,6,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path x:Name="ArrowPanelPath"
- VerticalAlignment="Center"
- Data="M0,0 L0,8 L4,4 z"
- Fill="{DynamicResource CheckedBrush}" />
- </Grid>
- <!-- Popup 是向下展开或横向展开(具体取决于该项所处的级别)的菜单的主体 -->
- <Popup x:Name="SubMenuPopup"
- AllowsTransparency="true"
- Focusable="false"
- IsOpen="{Binding Path=IsSubmenuOpen,
- RelativeSource={RelativeSource TemplatedParent}}"
- Placement="Right"
- PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
- VerticalOffset="-3">
- <Grid x:Name="SubMenu">
- <!-- <Border x:Name="SubMenuBorder" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/> -->
- <!-- StackPanel 保留菜单的子级。这是通过 IsItemsHost=True 来设置的 -->
- <Border x:Name="SubMenuBorder"
- Background="{DynamicResource ContextBackground}"
- BorderBrush="{DynamicResource ContextBorderBrush}"
- BorderThickness="0">
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
- </Border>
- </Grid>
- </Popup>
- </Grid>
- </Border>
- <!-- 这些触发器通过 Role 重新配置 MenuItem 的四种排列方式以显示不同级别的菜单 -->
- <ControlTemplate.Triggers>
- <!-- Role = TopLevelHeader: 这是菜单中的根菜单项;Popup 向下展开 -->
- <Trigger Property="Role" Value="TopLevelHeader">
- <Setter Property="Margin" Value="0,1,0,1" />
- <Setter Property="Padding" Value="3" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Grid.IsSharedSizeScope" Value="true" />
- <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- Role = TopLevelItem: 这是没有任何子项的顶级菜单的子菜单项 -->
- <Trigger Property="Role" Value="TopLevelItem">
- <Setter Property="Margin" Value="0,1,0,1" />
- <Setter Property="Padding" Value="3" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- Role = SubMenuHeader: 这是不包含子级的子菜单项 -->
- <Trigger Property="Role" Value="SubmenuHeader">
- <Setter Property="DockPanel.Dock" Value="Top" />
- <Setter Property="Padding" Value="0,2,0,2" />
- <Setter Property="Grid.IsSharedSizeScope" Value="true" />
- </Trigger>
- <!-- Role = SubMenuItem: 这是包含子级的子菜单项 -->
- <Trigger Property="Role" Value="SubmenuItem">
- <Setter Property="DockPanel.Dock" Value="Top" />
- <Setter Property="Padding" Value="0,2,0,2" />
- <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsSuspendingPopupAnimation" Value="true">
- <Setter TargetName="SubMenuPopup" Property="PopupAnimation" Value="None" />
- </Trigger>
- <!-- 如果不存在 Icon,我们会折叠 Icon Content -->
- <Trigger Property="Icon" Value="{x:Null}">
- <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <!-- GlyphPanel 包含 CheckMark -->
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
- <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource ContextHighlightBackground}" />
- </Trigger>
- <Trigger SourceName="SubMenuPopup" Property="AllowsTransparency" Value="true">
- <Setter TargetName="SubMenu" Property="Margin" Value="0,0,3,3" />
- <Setter TargetName="SubMenu" Property="SnapsToDevicePixels" Value="true" />
- <Setter TargetName="SubMenuBorder" Property="BitmapEffect" Value="{DynamicResource PopupDropShadow}" />
- </Trigger>
- <!-- 对 Menu Highlight 和 IsEnabled 使用系统颜色 -->
- <Trigger Property="IsHighlighted" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource ContextHighlightBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource ContextDisableForeground}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <!-- 上下文菜单 -->
- <Style TargetType="{x:Type ContextMenu}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Background" Value="{DynamicResource ContextBackground}" />
- <Setter Property="ItemContainerStyle" Value="{DynamicResource ContextCommonMenuItem}" />
- <Setter Property="BorderBrush" Value="{DynamicResource ContextBorderBrush}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ContextMenu}">
- <Grid>
- <Grid x:Name="PopupContentElement">
- <Border x:Name="TemplateBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{Binding BorderThickness,
- RelativeSource={RelativeSource TemplatedParent}}">
- <ItemsPresenter />
- </Border>
- </Grid>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="WindowBaseStyle" TargetType="windows:WindowBase">
- <Setter Property="Background" Value="{DynamicResource DialogBackgroundBrush}" />
- <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
- <Setter Property="BorderThickness" Value="4,2,4,4" />
- <Setter Property="CloseButtonStyle" Value="{DynamicResource DialogCloseButtonStyle}" />
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="TitleBackGround" Value="{DynamicResource CommonBorderBrush}" />
- </Style>
- <Style x:Key="NoticeListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="{DynamicResource List_Item_IsRead}" />
- <Setter Property="Padding" Value="2,0,0,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}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Foreground" Value="{DynamicResource List_Item_NotRead}" />
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Foreground" Value="{DynamicResource List_Item_NotRead}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="AccountPasswordBoxStyle" TargetType="{x:Type PasswordBox}">
- <Setter Property="Background" Value="White" />
- <Setter Property="PasswordChar" Value="●" />
- <Setter Property="FontSize" Value="13" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorder}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type PasswordBox}">
- <Grid Height="{TemplateBinding Height}"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <Border x:Name="Border"
- Height="{TemplateBinding Height}"
- Margin="0,0,8,0"
- Panel.ZIndex="1"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1" />
- <Border x:Name="MouseOverVisual"
- Height="{TemplateBinding Height}"
- Margin="0,0,8,0"
- Panel.ZIndex="1"
- BorderBrush="{DynamicResource TextBox_MouseOver}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1"
- Opacity="0" />
- <Border x:Name="FocusVisual"
- Height="{TemplateBinding Height}"
- Margin="0,0,8,0"
- Panel.ZIndex="1"
- BorderBrush="{DynamicResource TextBox_Focused}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="1"
- Opacity="0" />
- <Image Width="14"
- Height="14"
- Margin="12,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Panel.ZIndex="1"
- Source="{DynamicResource PasswordBoxIcon}" />
- <!--
- <Rectangle Width="12"
- Height="20"
- Margin="12,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Panel.ZIndex="1"
- Fill="{StaticResource PasswordBoxIcon}" />
- -->
- <ScrollViewer x:Name="PART_ContentHost"
- Margin="0,0,8,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Center"
- VerticalContentAlignment="Center"
- Panel.ZIndex="2"
- Background="{x:Null}"
- FontSize="{TemplateBinding FontSize}"
- Foreground="{TemplateBinding Foreground}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="MouseOverVisual" Property="Opacity" Value="1" />
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
- <Setter TargetName="FocusVisual" Property="Opacity" Value="1" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource TextBox_DisabledBorder}" />
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource TextBox_DisabledBackground}" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- <!--
- <DataTrigger Binding="{Binding TradePassword, UpdateSourceTrigger=PropertyChanged}" Value="{x:Null}">
- <Setter Property="Background" Value="{StaticResource TipBrush}" />
- </DataTrigger>
- -->
- <!--
- <DataTrigger Binding="{Binding TradePassword, UpdateSourceTrigger=PropertyChanged}" Value="">
- <Setter Property="Background" Value="{DynamicResource TipBrush}" />
- </DataTrigger>
- -->
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="OrderDeliveryCheckBoxStyle" TargetType="{x:Type CheckBox}">
- <Setter Property="Foreground" Value="{DynamicResource MainForegroundBrush}" />
- <Setter Property="Background" Value="{DynamicResource OrderPriceBackground}" />
- <Setter Property="Padding" Value="5" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type CheckBox}">
- <Grid Background="{TemplateBinding Background}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <ContentPresenter Grid.Row="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <Path x:Name="CheckMark"
- Margin="{TemplateBinding Padding}"
- Data="M8.5,5.75 L15.5,15.5 0.5,15.5 z"
- Fill="{TemplateBinding Foreground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Uniform">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="180" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Path x:Name="CheckMarkPath"
- Margin="{TemplateBinding Padding}"
- Data="M8.5,5.75 L15.5,15.5 0.5,15.5 z"
- Fill="{TemplateBinding Foreground}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Uniform">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="90" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="CheckMark" Property="Visibility" Value="Visible" />
- <Setter TargetName="CheckMarkPath" Property="Visibility" Value="Hidden" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="CheckMark" Property="Visibility" Value="Hidden" />
- <Setter TargetName="CheckMarkPath" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsChecked" Value="{x:Null}">
- <Setter TargetName="CheckMark" Property="Visibility" Value="Hidden" />
- <Setter TargetName="CheckMarkPath" Property="Visibility" Value="Hidden" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|