浏览代码

333

样式分支
fyf 2 年前
父节点
当前提交
bf8677b4ac
共有 5 个文件被更改,包括 68 次插入163 次删除
  1. +2
    -2
      BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
  2. +4
    -1
      BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs
  3. +4
    -1
      BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs
  4. +0
    -0
      BPASmartClient.SCADAControl/Images/btnnormal.png
  5. +58
    -159
      BPASmartClient.SCADAControl/Themes/Generic.xaml

+ 2
- 2
BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj 查看文件

@@ -12,7 +12,7 @@
<None Remove="Images\2609.png" />
<None Remove="Images\biogebj.png" />
<None Remove="Images\bj.png" />
<None Remove="Images\btn_normal.png" />
<None Remove="Images\btnnormal.png" />
<None Remove="Images\button1.png" />
<None Remove="Images\button2.png" />
<None Remove="Images\Cb_Checked.png" />
@@ -63,7 +63,7 @@
<Resource Include="Images\bj.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\btn_normal.png">
<Resource Include="Images\btnnormal.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Cb_Checked.png">


+ 4
- 1
BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs 查看文件

@@ -30,7 +30,10 @@ namespace BPASmartClient.SCADAControl.CustomerControls
public TheDataGrid()
{
InitializeComponent();
Style = Application.Current.Resources["DesignTheDataGrid"] as Style;
ResourceDictionary languageResDic = new ResourceDictionary();
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute);
this.Resources.MergedDictionaries.Add(languageResDic);
// Style = Application.Current.Resources["DesignTheDataGrid"] as Style;
MinWidth = 100;
MinHeight = 100;
ItemsString =new ItemsListObj()


+ 4
- 1
BPASmartClient.SCADAControl/CustomerControls/TheListBox.xaml.cs 查看文件

@@ -30,7 +30,10 @@ namespace BPASmartClient.SCADAControl.CustomerControls
public TheListBox()
{
InitializeComponent();
Style = Application.Current.Resources["DesignTheListBox"] as Style;
ResourceDictionary languageResDic = new ResourceDictionary();
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute);
this.Resources.MergedDictionaries.Add(languageResDic);
//Style = Application.Current.Resources["DesignTheListBox"] as Style;
MinWidth = 100;
MinHeight = 100;
ItemsString = new ItemsListObj()


BPASmartClient.SCADAControl/Images/btn_normal.png → BPASmartClient.SCADAControl/Images/btnnormal.png 查看文件


+ 58
- 159
BPASmartClient.SCADAControl/Themes/Generic.xaml 查看文件

@@ -261,8 +261,8 @@
</Setter>
</Style.Setters>
</Style>
<Style TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type ctrl:TheTextBox}">
<Setter Property="BorderBrush" Value="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="0" />
@@ -307,7 +307,53 @@
</MultiTrigger>
</Style.Triggers>
</Style>

<Style TargetType="{x:Type ctrl:NumberBox}">
<Setter Property="BorderBrush" Value="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Height" Value="24" />
<Setter Property="CaretBrush" Value="White" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Themes1:ClassicBorderDecorator
x:Name="Bd"
BorderBrush="{DynamicResource borderBrush}"
BorderStyle="None"
BorderThickness="1">
<ScrollViewer x:Name="PART_ContentHost" />
</Themes1:ClassicBorderDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
<Condition Property="IsSelectionActive" Value="false" />
<Condition Property="IsSelectionActive" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
</MultiTrigger>
</Style.Triggers>
</Style>

<Style TargetType="{x:Type ctrl:TheTextBlock}">
<Style.Setters>
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
@@ -440,12 +486,6 @@
</Setter>
</Style>

<Style TargetType="{x:Type ctrl:NumberBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
</Style>
<Style TargetType="{x:Type ctrl:TheTextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
</Style>
<Style TargetType="{x:Type ctrl:TheCheckBox}">
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
@@ -545,7 +585,9 @@
</Setter.Value>
</Setter>
</Style>
<Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
<Style x:Key="ComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
@@ -590,6 +632,7 @@
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="AllowDrop" Value="true" />
@@ -612,6 +655,7 @@
</Setter.Value>
</Setter>
</Style>

<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
<Border
Background="{TemplateBinding Background}"
@@ -715,152 +759,6 @@
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="BaseComboBoxStyle" TargetType="{x:Type ComboBox}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{DynamicResource borderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Height" Value="24" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="IsTextSearchCaseSensitive" Value="true" />
<Setter Property="IsEditable" Value="true" />
<Setter Property="StaysOpenOnEdit" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBox}">

<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<Grid>
<Themes1:ClassicBorderDecorator
x:Name="Border"
BorderBrush="{x:Static Themes1:ClassicBorderDecorator.ClassicBorderBrush}"
BorderStyle="None"
BorderThickness="2">
<Popup
x:Name="PART_Popup"
AllowsTransparency="true"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<Themes1:SystemDropShadowChrome
x:Name="Shdw"
MinWidth="{Binding ActualWidth, ElementName=Border}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Color="Transparent">
<Border
x:Name="DropDownBorder"
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
BorderThickness="1">
<Border.Background>
<ImageBrush ImageSource="../Images/nbbj.png" />
</Border.Background>
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid RenderOptions.ClearTypeHint="Enabled">
<Canvas
Width="0"
Height="0"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle
x:Name="OpaqueRect"
Width="{Binding ActualWidth, ElementName=DropDownBorder}"
Height="{Binding ActualHeight, ElementName=DropDownBorder}"
Fill="{Binding Background, ElementName=DropDownBorder}" />
</Canvas>
<ItemsPresenter
x:Name="ItemsPresenter"
KeyboardNavigation.DirectionalNavigation="Contained"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</ScrollViewer>
</Border>
</Themes1:SystemDropShadowChrome>
</Popup>
</Themes1:ClassicBorderDecorator>
<DockPanel Margin="2">
<FrameworkElement Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" DockPanel.Dock="Right" />
<Border x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}">
<ContentPresenter
Margin="1,1,1,1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</DockPanel>
<ToggleButton
Width="Auto"
MinWidth="0"
MinHeight="0"
Margin="2"
ClickMode="Press"
Focusable="false"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxTransparentButtonStyle}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<!--<Condition Property="IsSelectionBoxHighlighted" Value="true"/>-->
<Condition Property="IsDropDownOpen" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
</MultiTrigger>
<!--<Trigger Property="IsSelectionBoxHighlighted" Value="true">
<Setter Property="Background" TargetName="SelectedItemBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>-->
<Trigger Property="HasItems" Value="false">
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true" />
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</MultiTrigger>
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
<Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
<Setter TargetName="Shdw" Property="Color" Value="#71000000" />
</Trigger>
<Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
<Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
<Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEditable" Value="true">
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
</Trigger>
</Style.Triggers>

</Style>

<Style TargetType="{x:Type ctrl:TheComboBox}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
@@ -1010,9 +908,9 @@

</Style>
<Style BasedOn="{StaticResource BaseComboBoxStyle}" TargetType="ComboBox" />

<Style x:Key="DesignTheDataGrid" TargetType="{x:Type ctrl:TheDataGrid}">
<Style TargetType="{x:Type ctrl:TheDataGrid}">
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="CanUserAddRows" Value="False" />
@@ -1258,7 +1156,7 @@

<SolidColorBrush x:Key="ListBorder" Color="#828790" />

<Style x:Key="DesignTheListBox" TargetType="{x:Type ListBox}">
<Style TargetType="{x:Type ctrl:TheListBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{StaticResource ListBorder}" />
<Setter Property="BorderThickness" Value="0" />
@@ -1349,13 +1247,14 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ctrl:TheRadioButton}">
<Setter Property="FocusVisualStyle" Value="{StaticResource CheckRadioFocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource foreground}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/btn_normal.png" />
<ImageBrush ImageSource="../Images/btnnormal.png" />
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="2,0,0,0" />


正在加载...
取消
保存