123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <Application x:Class="MeterVision.App"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:MeterVision">
- <!--StartupUri="MainWindow.xaml">-->
-
- <Application.Resources>
-
- <ResourceDictionary>
-
- <!--<ResourceDictionary.MergedDictionaries>
-
- --><!-- Primary resource dictionary --><!--
- <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
- --><!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
- --><!-- Icon pack --><!--
- <ResourceDictionary Source="pack://application:,,,/MaterialDesignIcons.Wpf;component/Themes/MaterialDesignIcons.xaml" />-->
- <!--<ResourceDictionary Source="pack://application:,,,/FontAwesome.WPF;component/Themes/Regular.xaml"/>--><!--
- </ResourceDictionary.MergedDictionaries>-->
- <Style TargetType="TextBlock">
- <Setter Property="Text" Value="{Binding}" />
- </Style>
- <!--带有虚线的Brush Start-->
- <DrawingBrush x:Key="borderBrush" Viewport="0,0,8,8" ViewportUnits="Absolute" TileMode="Tile">
- <DrawingBrush.Drawing>
- <DrawingGroup>
- <GeometryDrawing Brush="#008000">
- <GeometryDrawing.Geometry>
- <GeometryGroup>
- <RectangleGeometry Rect="0,0,50,50" />
- <RectangleGeometry Rect="50,50,50,50" />
- </GeometryGroup>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingGroup>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- <!--带有虚线的Brush End-->
- <!--控制移动的按钮样式 Start-->
- <Style x:Key="MoveButtonStyle" TargetType="{x:Type Button}">
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" Value="#000000" />
- <Setter Property="BorderThickness" Value="1" />
- </Trigger>
- </Style.Triggers>
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- </Style>
- <!--控制移动的按钮样式 End-->
- <!--控制移动的按钮样式 Start-->
- <Style x:Key="MoveButtonStyle1" TargetType="{x:Type Button}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border Background="{TemplateBinding Background}" BorderBrush="#007ACC"
- BorderThickness="{TemplateBinding BorderThickness}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#CCCEDB"/>
- <Setter Property="BorderThickness" Value="1"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <!--控制移动的按钮样式 End-->
- <!--控制移动的按钮样式 Start2-->
- <Style x:Key="MoveButtonStyle2" TargetType="{x:Type Button}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border Background="{TemplateBinding Background}" BorderBrush="#007ACC"
- BorderThickness="{TemplateBinding BorderThickness}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderThickness" Value="1"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <!--控制移动的按钮样式 End2-->
- <!--<DataGrid.RowStyle >-->
- <Style x:Key="dataGridRowStyle" TargetType="DataGridRow">
- <Setter Property="Background" Value="White"/>
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Height" Value="30"/>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#CEDBEF"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="#A8C6EE"/>
- <!--<Setter Property="Foreground" Value="White" />-->
- </Trigger>
- </Style.Triggers>
- </Style>
- <!--</DataGrid.RowStyle>-->
- <Style x:Key="dataGridCellStyle" TargetType="DataGridCell">
- <Setter Property="BorderThickness" Value="0"/>
- <!--<Setter Property="MinWidth" Value="85"/>-->
- <Style.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="#A8C6EE"/>
- <Setter Property="Foreground" Value="#000000"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <!--登陆页面按钮样式2020-07-07 guozhao-->
- <Style x:Key="NewButton" TargetType="{x:Type Button}">
- <Setter Property="Padding" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid Cursor="Hand">
- <Border x:Name="_Border" Background="{TemplateBinding Background}" CornerRadius="5" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
- </Border>
- <!--ContentPresenter的作用就是显示内容,但Control类没有这个Content属性,所以在Control类之上写了一个ContentControl类,然后ContentPresenter(其显示依赖于ContentControl类)负责将ContentControl的Content属性显示出来。每个控件都有一个默认的ContentPresenter用于显示Content内容,这种控件为内容控件-->
- <!--SnapsToDevicePixels获取或设置一个值,该值确定在呈现过程中,此元素的呈现是否应使用特定于设备的像素设置。 这是依赖项属性。-->
- <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Grid>
- <!--定义触发器-->
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" TargetName="_Border">
- <Setter.Value>
- <SolidColorBrush Color="#ef3c62"/>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Background" TargetName="_Border">
- <Setter.Value>
- <SolidColorBrush Color="Gray"/>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- <!--定义触发器_End-->
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--登陆页面按钮样式结束-->
- <!--列车晚点表格的样式Start-->
- <Style x:Key="dataGridRowStyle_Lcwd" TargetType="DataGridRow">
- <Setter Property="Background" Value="White"/>
- <Setter Property="Foreground" Value="#0000FF"/>
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <!--<Setter Property="Height" Value="35"/>-->
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#EEEEF2"/>
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="#EDF1F2"/>
- <!--<Setter Property="Foreground" Value="Red" />-->
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="dataGridCellStyle_Lcwd" TargetType="DataGridCell">
- <Setter Property="BorderThickness" Value="0"/>
- <!--<Setter Property="MinWidth" Value="85"/>-->
- <Style.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="#EDF1F2"/>
- <Setter Property="Foreground" Value="#0000FF"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="contentCenterStyle" TargetType="{x:Type TextBlock}">
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="Margin" Value="5,0,0,0" />
- </Style>
- <!--列车晚点表格的样式End-->
- <!--按钮样式开始-->
- <Style x:Key="MyWpfButton1" TargetType="{x:Type Button}" >
- <Setter Property="Background" Value="{StaticResource LinearGradientBlueBackground1}"></Setter>
- <Setter Property="Foreground" Value="#000000"></Setter>
- <Setter Property="BorderBrush" Value="{StaticResource MyBtnBorderColor1}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
- SnapsToDevicePixels="true" CornerRadius="3,3,3,3">
- <ContentPresenter x:Name="contentPresenter"
- Focusable="False"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" TargetName="border" Value="{StaticResource MyBtnHoverBackgroundColor1}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--按钮样式结束-->
- <!--自定义颜色-->
- <LinearGradientBrush x:Key="LinearGradientBlueBackground1" EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFFFFFFF" Offset="0" />
- <GradientStop Color="#FFE6E6E6" Offset="1" />
- </LinearGradientBrush>
- <SolidColorBrush x:Key="MyBtnBorderColor1" Color="#FF4E4E4E"></SolidColorBrush>
- <SolidColorBrush x:Key="MyBtnHoverBackgroundColor1" Color="#FFE3E3E3"></SolidColorBrush>
- <!--END-->
- <Style x:Key="MyWpfButton2" TargetType="{x:Type Button}" >
- <Setter Property="Background" Value="{StaticResource LinearGradientBlueBackground1}"></Setter>
- <Setter Property="Foreground" Value="#000000"></Setter>
- <Setter Property="BorderBrush" Value="{StaticResource MyBtnBorderColor1}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
- SnapsToDevicePixels="true" CornerRadius="3,3,3,3">
- <ContentPresenter x:Name="contentPresenter"
- Focusable="False"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" TargetName="border" Value="{StaticResource MyBtnHoverBackgroundColor1}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="DatePickerTextBox">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <TextBox Text="{Binding Path=SelectedDate, StringFormat='yyyy-MM-dd', RelativeSource={RelativeSource AncestorType=DatePicker}}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </ResourceDictionary>
- </Application.Resources>
- </Application>
|