| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:button="clr-namespace:Muchinfo.WPF.Controls.Button;assembly=Muchinfo.WPF.Controls"
- xmlns:converters="clr-namespace:Muchinfo.MTPClient.Converters"
- xmlns:windows="clr-namespace:Muchinfo.WPF.Controls.Windows;assembly=Muchinfo.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 MuchinfoBrush1}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="CommonButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush66}" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter Property="FocusVisualStyle" Value="{DynamicResource ButtonFocusVisual}" />
- <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">
- <Border x:Name="OutsideBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0"
- Visibility="Collapsed" />
- <Border x:Name="InnerBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0"
- 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 MuchinfoBrush9}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource MuchinfoBrush13}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True ">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Visible" />
- <Setter TargetName="InnerBorder" Property="Background" Value="{DynamicResource MuchinfoBrush48}" />
- <Setter TargetName="OutsideBorder" Property="Background" Value="{DynamicResource MuchinfoBrush48}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="OutsideBorder" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="MainGrid" Property="Margin" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="CheckContractsButtonStyle"
- BasedOn="{StaticResource CommonButtonStyle}"
- TargetType="Button">
- <Setter Property="Height" Value="32" />
- </Style>
- <Style x:Key="InvestmentProductButtonStyle"
- BasedOn="{StaticResource CommonButtonStyle}"
- TargetType="Button">
- <Setter Property="Height" Value="35" />
- </Style>
- <!-- 文本按钮 -->
- <Style x:Key="TextButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush12}" />
- <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">
- <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 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="DialogMaxButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Width" Value="20" />
- <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">
- <Image x:Name="image"
- Source="{DynamicResource DialogWindowmax}"
- Stretch="Uniform" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="image" Property="Source" Value="{DynamicResource DialogWindowmax}" />
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 窗口最大化按钮样式 -->
- <Style x:Key="DialogMaxButtonStyle1" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Width" Value="20" />
- <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">
- <Image x:Name="image"
- Source="{DynamicResource DialogWindowmax1}"
- Stretch="Uniform" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="image" Property="Source" Value="{DynamicResource DialogWindowmax1}" />
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </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="{DynamicResource MuchinfoBrush7}"
- 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="{DynamicResource MuchinfoBrush10}"
- StrokeThickness="1" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource MuchinfoBrush40}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource MuchinfoBrush40}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
- <Setter TargetName="Rectangle" Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="AccountComboBoxToggleButton"
- BasedOn="{x:Null}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Height" Value="24" />
- <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="{DynamicResource MuchinfoBrush4}"
- 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="{DynamicResource MuchinfoBrush10}"
- StrokeThickness="1" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource MuchinfoBrush40}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource MuchinfoBrush40}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Rectangle" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
- <Setter TargetName="Rectangle" Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 这是包含 ComboBox 中的选定项的区域 -->
- <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
- <!-- 必须将其命名为 PART_ContentHost -->
- <Border x:Name="PART_ContentHost"
- Background="{TemplateBinding Background}"
- Focusable="False" />
- </ControlTemplate>
- <!-- Simple ComboBoxItem - 它用于 ComboBox 中的每个项。可以更改下面每个项的选定颜色 -->
- <Style TargetType="{x:Type ComboBoxItem}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBoxItem}">
- <Grid SnapsToDevicePixels="true">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Grid>
- <ControlTemplate.Triggers>
- <!-- 更改 IsHighlighted SelectedBackgroundBrush,以设置各项的选择颜色 -->
- <Trigger Property="IsHighlighted" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource MuchinfoBrush49}" />
- </Trigger>
- <!-- SelectedBackgroundBrush -->
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- Simple ComboBox
- 它使用 ComboBoxToggleButton 来展开和折叠 Popup 控件
- 使用 SimpleScrollViewer 可使项滚动,而使用 SimpleComboBoxItem 可定义每个项的外观
- Popup 显示了 StackPanel 中的项的列表
- -->
- <Style x:Key="BaseComboxStyle" TargetType="{x:Type ComboBox}">
- <Setter Property="Height" Value="24" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen -->
- <ToggleButton x:Name="ToggleButton"
- Grid.ColumnSpan="2"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- ClickMode="Press"
- Focusable="false"
- IsChecked="{Binding IsDropDownOpen,
- Mode=TwoWay,
- RelativeSource={RelativeSource TemplatedParent}}"
- Style="{DynamicResource ComboBoxToggleButton}" />
- <ContentPresenter x:Name="ContentSite"
- Margin="3,0,3,0"
- VerticalAlignment="Center"
- Content="{TemplateBinding SelectionBoxItem}"
- ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
- ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
- IsHitTestVisible="False" />
- <Rectangle x:Name="enableRectangle"
- Grid.ColumnSpan="2"
- Fill="{DynamicResource MuchinfoBrush7}"
- Opacity="0.7"
- Visibility="Collapsed" />
- <!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 -->
- <TextBox x:Name="PART_EditableTextBox"
- Margin="3"
- VerticalAlignment="Stretch"
- Background="Transparent"
- BorderThickness="0"
- Focusable="True"
- IsReadOnly="{TemplateBinding IsReadOnly}"
- Visibility="Hidden" />
- <!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen -->
- <Popup x:Name="Popup"
- AllowsTransparency="True"
- Focusable="False"
- IsOpen="{TemplateBinding IsDropDownOpen}"
- Placement="Bottom"
- PopupAnimation="Fade">
- <Grid x:Name="DropDown"
- MinWidth="{TemplateBinding ActualWidth}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- SnapsToDevicePixels="True">
- <Border x:Name="DropDownBorder"
- Background="{DynamicResource MuchinfoBrush1}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1" />
- <ScrollViewer Margin="4,2,4,6"
- CanContentScroll="True"
- HorizontalScrollBarVisibility="Auto"
- SnapsToDevicePixels="True"
- Style="{DynamicResource SimpleScrollViewer}"
- VerticalScrollBarVisibility="Auto">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
- </ScrollViewer>
- </Grid>
- </Popup>
- </Grid>
- <ControlTemplate.Triggers>
- <!-- 这会强制 DropDown 的大小有最小限制(如果它为空) -->
- <Trigger Property="HasItems" Value="false">
- <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="enableRectangle" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- <Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
- <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
- <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
- </Trigger>
- <Trigger Property="IsEditable" Value="true">
- <Setter Property="IsTabStop" Value="false" />
- <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
- <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="LoginComboxStyle" TargetType="{x:Type ComboBox}">
- <Setter Property="Height" Value="24" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen -->
- <ToggleButton x:Name="ToggleButton"
- Grid.ColumnSpan="2"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- ClickMode="Press"
- Focusable="false"
- IsChecked="{Binding IsDropDownOpen,
- Mode=TwoWay,
- RelativeSource={RelativeSource TemplatedParent}}"
- Style="{DynamicResource ComboBoxToggleButton}" />
- <ContentPresenter x:Name="ContentSite"
- Margin="3,0,3,0"
- VerticalAlignment="Center"
- Content="{TemplateBinding SelectionBoxItem}"
- ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
- ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
- IsHitTestVisible="False" />
- <Rectangle x:Name="enableRectangle"
- Grid.ColumnSpan="2"
- Fill="{DynamicResource MuchinfoBrush64}"
- Opacity="0.7"
- Visibility="Collapsed" />
- <!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 -->
- <TextBox x:Name="PART_EditableTextBox"
- Margin="3"
- VerticalAlignment="Stretch"
- Background="Transparent"
- BorderThickness="0"
- Focusable="True"
- IsReadOnly="{TemplateBinding IsReadOnly}"
- Visibility="Hidden" />
- <!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen -->
- <Popup x:Name="Popup"
- AllowsTransparency="True"
- Focusable="False"
- IsOpen="{TemplateBinding IsDropDownOpen}"
- Placement="Bottom"
- PopupAnimation="Fade">
- <Grid x:Name="DropDown"
- MinWidth="{TemplateBinding ActualWidth}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- SnapsToDevicePixels="True">
- <Border x:Name="DropDownBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1" />
- <ScrollViewer Margin="4,2,4,6"
- CanContentScroll="True"
- HorizontalScrollBarVisibility="Auto"
- SnapsToDevicePixels="True"
- Style="{DynamicResource SimpleScrollViewer}"
- VerticalScrollBarVisibility="Auto">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
- </ScrollViewer>
- </Grid>
- </Popup>
- </Grid>
- <ControlTemplate.Triggers>
- <!-- 这会强制 DropDown 的大小有最小限制(如果它为空) -->
- <Trigger Property="HasItems" Value="false">
- <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="enableRectangle" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- <Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
- <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
- <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
- </Trigger>
- <Trigger Property="IsEditable" Value="true">
- <Setter Property="IsTabStop" Value="false" />
- <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
- <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="AccountComboBoxStyle" TargetType="{x:Type ComboBox}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush4}" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush7}" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen -->
- <ToggleButton x:Name="ToggleButton"
- Grid.ColumnSpan="2"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- ClickMode="Press"
- Focusable="false"
- IsChecked="{Binding IsDropDownOpen,
- Mode=TwoWay,
- RelativeSource={RelativeSource TemplatedParent}}"
- Style="{DynamicResource AccountComboBoxToggleButton}" />
- <ContentPresenter x:Name="ContentSite"
- Margin="3"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Content="{TemplateBinding SelectionBoxItem}"
- ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
- ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
- IsHitTestVisible="False" />
- <Rectangle x:Name="enableRectangle"
- Grid.ColumnSpan="2"
- Fill="{DynamicResource MuchinfoBrush15}"
- Opacity="0.7"
- Visibility="Collapsed" />
- <!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 -->
- <TextBox x:Name="PART_EditableTextBox"
- Margin="3"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- BorderThickness="0"
- Focusable="True"
- IsReadOnly="{TemplateBinding IsReadOnly}"
- Visibility="Hidden" />
- <!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen -->
- <Popup x:Name="Popup"
- AllowsTransparency="True"
- Focusable="False"
- IsOpen="{TemplateBinding IsDropDownOpen}"
- Placement="Bottom"
- PopupAnimation="Fade">
- <Grid x:Name="DropDown"
- MinWidth="{TemplateBinding ActualWidth}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- SnapsToDevicePixels="True">
- <Border x:Name="DropDownBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1" />
- <ScrollViewer Margin="4,2,4,6"
- CanContentScroll="True"
- HorizontalScrollBarVisibility="Auto"
- SnapsToDevicePixels="True"
- Style="{DynamicResource SimpleScrollViewer}"
- VerticalScrollBarVisibility="Auto">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
- </ScrollViewer>
- </Grid>
- </Popup>
- </Grid>
- <ControlTemplate.Triggers>
- <!-- 这会强制 DropDown 的大小有最小限制(如果它为空) -->
- <Trigger Property="HasItems" Value="false">
- <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="enableRectangle" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- <Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
- <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
- <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
- </Trigger>
- <Trigger Property="IsEditable" Value="true">
- <Setter Property="IsTabStop" Value="false" />
- <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
- <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="TopToggleButtonStyel" TargetType="{x:Type ToggleButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Margin="0,0,0,2" HorizontalAlignment="Left">
- <Path x:Name="rec"
- Data="M0.25,0.063333333 L0,47.063667 10,47.063667 19,38.56394 19.25,-0.18633511 z"
- Fill="{DynamicResource MuchinfoBrush4}"
- Stretch="Fill" />
- <TextBlock Width="{TemplateBinding Width}"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Foreground="{DynamicResource MuchinfoBrush11}"
- Padding="0,3,0,3"
- Text="{TemplateBinding Content}"
- TextWrapping="Wrap" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="rec" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="rec" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="rec" Property="Fill" Value="{DynamicResource MuchinfoBrush25}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="CommonRadioButtonStyle" TargetType="{x:Type RadioButton}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter Property="Padding" Value="5,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RadioButton}">
- <!-- BulletDecorator 用于提供 checkmark 与 Content 之间的基线对齐 -->
- <StackPanel Background="{TemplateBinding Background}" Orientation="Horizontal">
- <Grid Width="13" Height="13">
- <Ellipse x:Name="Ellipse_Border"
- Stroke="{TemplateBinding BorderBrush}"
- StrokeThickness="1" />
- <Ellipse x:Name="CheckMark"
- Margin="4"
- Fill="{TemplateBinding BorderBrush}" />
- </Grid>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True" />
- </StackPanel>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Ellipse_Border" Property="Fill" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Ellipse_Border" Property="Fill" Value="{DynamicResource PressedBrush}" />
- <Setter TargetName="Ellipse_Border" Property="Stroke" Value="{DynamicResource GlyphBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false" />
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="CommonCheckBoxStyle" TargetType="{x:Type CheckBox}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush10}" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
- <Setter Property="Padding" Value="6,0,0,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type CheckBox}">
- <!--
- BulletDecorator 用于提供 checkma
- rk 与 Content 之间的基线对齐
- -->
- <BulletDecorator Background="Transparent">
- <BulletDecorator.Bullet>
- <Grid Width="13" Height="13">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <Path x:Name="CheckMark"
- Data="M1.5,5.7816667 C2.125,6.1566667 5.75,10.906333 5.75,10.906333 L12.5,0.78165909"
- SnapsToDevicePixels="False"
- Stroke="{DynamicResource MuchinfoBrush10}"
- StrokeThickness="2" />
- </Grid>
- </BulletDecorator.Bullet>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True" />
- </BulletDecorator>
- <!-- 它使用 Visibility 来基于 IsChecked 隐藏和显示 CheckMark -->
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource PressedBrush}" />
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource PressedBorderBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false" />
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="LeftToggleButtonStyelFinacing" TargetType="{x:Type ToggleButton}">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <WrapPanel Width="{TemplateBinding Width}"
- Height="18"
- MinWidth="{TemplateBinding MinWidth}"
- Margin="0,0,0,0"
- HorizontalAlignment="Left">
- <Path x:Name="rec1"
- Data="M 5,0 L 18,5 L 18,0"
- Fill="{DynamicResource MuchinfoBrush5}"
- Stretch="Fill" />
- <StackPanel x:Name="stack1"
- Background="{DynamicResource MuchinfoBrush5}"
- Orientation="Horizontal">
- <TextBlock x:Name="txt"
- Margin="5,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush14}"
- Text="{TemplateBinding Content}" />
- </StackPanel>
- <Path x:Name="rec2"
- Data="M 0,0 L 5,18 L 0,18"
- Fill="{DynamicResource MuchinfoBrush5}"
- Stretch="Fill" />
- </WrapPanel>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="txt" Property="Foreground" Value="{DynamicResource MuchinfoBrush2}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="LeftToggleButtonStyel" TargetType="{x:Type ToggleButton}">
- <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 MuchinfoBrush5}"
- Stretch="Fill" />
- <StackPanel x:Name="stack1"
- Grid.Column="1"
- Background="{DynamicResource MuchinfoBrush5}"
- Orientation="Horizontal">
- <TextBlock x:Name="txt"
- Margin="5,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="{DynamicResource MuchinfoBrush12}"
- Text="{TemplateBinding Content}" />
- </StackPanel>
- <Path x:Name="rec2"
- Grid.Column="2"
- Data="M 0,0 L 3,7 L 0,18"
- Fill="{DynamicResource MuchinfoBrush5}"
- Stretch="Fill" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Cursor" Value="Hand" />
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="rec1" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="rec2" Property="Fill" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="txt" Property="Foreground" Value="{DynamicResource MuchinfoBrush5}" />
- <Setter TargetName="stack1" Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 主页隐藏与展开按键 -->
- <Style x:Key="HideImageButtonStyle" TargetType="{x:Type button:ImageButton}">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="NormalImageSource" Value="{DynamicResource AccountHideImage}" />
- <Setter Property="HoverImageSource" Value="{DynamicResource AccountHideImage}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type button:ImageButton}">
- <Border x:Name="ContentContainer" CornerRadius="1">
- <Image x:Name="image"
- Width="{TemplateBinding ImageWidth}"
- Height="{TemplateBinding ImageHeight}"
- Source="{TemplateBinding NormalImageSource}"
- Stretch="Uniform" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="NormalImageSource" Value="{DynamicResource AccountHideImage_p}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 窗口关闭按钮样式 -->
- <Style x:Key="DialogCloseButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Width" Value="20" />
- <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">
- <Image x:Name="image"
- Source="{DynamicResource DialogCloseImg}"
- Stretch="Uniform" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="image" Property="Source" Value="{DynamicResource DialogCloseImg_P}" />
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ContentContainer" Property="Background" Value="{DynamicResource MuchinfoBrush50}" />
- </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="lightComboboxStyle"
- BasedOn="{StaticResource BaseComboxStyle}"
- TargetType="{x:Type ComboBox}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush7}" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- </Style>
- <Style x:Key="lightLoginComboboxStyle"
- BasedOn="{StaticResource LoginComboxStyle}"
- TargetType="{x:Type ComboBox}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- </Style>
- <Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="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 MuchinfoBrush13}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
- <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}"
- SnapsToDevicePixels="True">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="1" />
- <ColumnDefinition Width="20" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- Focusable="False"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <Border Grid.Column="1"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <Grid Grid.Column="2"
- 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}">
- <RepeatButton.ContentTemplate>
- <DataTemplate>
- <Path Width="12"
- Margin="0,3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M57.946471,292.46228 L68.652254,275.94555 80.499987,292.46228"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource MuchinfoBrush22}"
- StrokeThickness="1" />
- </DataTemplate>
- </RepeatButton.ContentTemplate>
- </RepeatButton>
- <Border Grid.Row="1"
- HorizontalAlignment="Stretch"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}" />
- <RepeatButton x:Name="PART_DecreaseButton"
- Grid.Row="2"
- IsTabStop="{TemplateBinding IsTabStop}"
- Style="{DynamicResource RepeatButtonStyle}">
- <RepeatButton.ContentTemplate>
- <DataTemplate>
- <Path Width="12"
- Margin="0,3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M58,276 L69.036054,292.40871 80.517829,276.05476"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource MuchinfoBrush22}"
- StrokeThickness="1" />
- </DataTemplate>
- </RepeatButton.ContentTemplate>
- </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>
- <Trigger SourceName="PART_IncreaseButton" Property="IsEnabled" Value="False">
- <Setter TargetName="PART_IncreaseButton" Property="ContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <Path Width="12"
- Margin="0,3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M57.946471,292.46228 L68.652254,275.94555 80.499987,292.46228"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource MuchinfoBrush14}"
- StrokeThickness="1" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger SourceName="PART_DecreaseButton" Property="IsEnabled" Value="False">
- <Setter TargetName="PART_DecreaseButton" Property="ContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <Path Width="12"
- Margin="0,3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M58,276 L69.036054,292.40871 80.517829,276.05476"
- Focusable="False"
- SnapsToDevicePixels="True"
- Stretch="Fill"
- Stroke="{DynamicResource MuchinfoBrush14}"
- StrokeThickness="1" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </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 MuchinfoBrush1}" />
- </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 SingleUpDown 样式 -->
- <Style x:Key="SingleUpDownStyle" TargetType="{x:Type xctk:SingleUpDown}">
- <Setter Property="Height" Value="24" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush7}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="ClipValueToMinMax" Value="True" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush10}" />
- <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 MuchinfoBrush1}" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type xctk:SingleUpDown}">
- <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 MuchinfoBrush7}"
- 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>
- <!-- tookit SingleUpDown 样式 -->
- <Style x:Key="DecimalUpDownStyle" TargetType="{x:Type xctk:DecimalUpDown}">
- <Setter Property="Height" Value="24" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush7}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="ClipValueToMinMax" Value="True" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush10}" />
- <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 MuchinfoBrush1}" />
- </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 MuchinfoBrush7}"
- 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"
- Style="{DynamicResource SimpleScrollViewer}">
- <!-- StackPanel 用来显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel Margin="2" 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="Height" Value="20" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Margin" Value="2,1" />
- <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}" />
- <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>
- <!-- 此 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="Height" Value="22" />
- <Setter Property="MinWidth" Value="40" />
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush38}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush39}" />
- <Setter Property="BorderThickness" Value="0,0,0,1" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush13}" />
- <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 MuchinfoBrush2}" />
- </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 MuchinfoBrush40}"
- BorderThickness="1">
- <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="6,3,6,3" />
- <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="6,3,6,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" />
- </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 MuchinfoBrush3}" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush5}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <!-- 上下文菜单 -->
- <Style TargetType="ContextMenu">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush40}" />
- </Style>
- <ControlTemplate x:Key="NewsToggleButton" TargetType="{x:Type ToggleButton}">
- <Border x:Name="Border"
- BorderThickness="0"
- CornerRadius="2"
- TextBlock.Foreground="{DynamicResource MuchinfoBrush10}">
- <ContentPresenter Margin="5,1,5,1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,2" />
- <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="Border" Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- <Setter TargetName="Border" Property="TextBlock.Foreground" Value="{DynamicResource MuchinfoBrush1}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style x:Key="WindowBaseStyle" TargetType="windows:WindowBase">
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush66}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush6}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="CloseButtonStyle" Value="{DynamicResource DialogCloseButtonStyle}" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush81}" />
- <Setter Property="TitleBackGround" Value="{DynamicResource MuchinfoBrush6}" />
- </Style>
- <Style TargetType="{x:Type windows:MuchinfoMessageBox}">
- <Setter Property="ButtonStyle" Value="{DynamicResource CommonButtonStyle}" />
- </Style>
- <Style x:Key="ButtonNotIsEnable" TargetType="Button">
- <Setter Property="Width" Value="110" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush12}" />
- <Setter Property="Background" Value="#CCCCCC" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Padding" Value="20,5" />
- <Setter Property="FocusVisualStyle" Value="{DynamicResource ButtonFocusVisual}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Border Name="Part_BackGround"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="0"
- CornerRadius="4,4,0,0">
- <ContentPresenter HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding ContentControl.Content}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ButtonIsEnable"
- BasedOn="{StaticResource ButtonNotIsEnable}"
- TargetType="Button">
- <Setter Property="Background" Value="{DynamicResource MuchinfoBrush3}" />
- </Style>
- </ResourceDictionary>
|