zoukankan      html  css  js  c++  java
  • 全局 Style

    1.定义一个全局资源文件,如下

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
                        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                        xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
                        xmlns:local="clr-namespace:Haitai.Wpf">
        <DataTemplate x:Key="MaskTemplate">
            <Grid>
                <ContentControl Content="{Binding}"></ContentControl>
                <Grid Background="#3F000000">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <local:LoadingAdorner></local:LoadingAdorner>
                    </StackPanel>
                </Grid>
            </Grid>
        </DataTemplate>
        <Style TargetType="dxb:BarManager">
            <Setter Property="MDIMergeStyle" Value="Default"></Setter>
            <Setter Property="AllowCustomization" Value="False"></Setter>
            <Setter Property="AllowQuickCustomization" Value="False"></Setter>
            <Setter Property="AllowHotCustomization" Value="False"></Setter>
        </Style>
        <Style TargetType="dxb:Bar">
            <Setter Property="ShowDragWidget" Value="False"></Setter>
            <Setter Property="AllowCustomizationMenu" Value="False"></Setter>
            <Setter Property="AllowQuickCustomization" Value="False"></Setter>
            <Setter Property="AllowHide" Value="False"></Setter>
        </Style>
        <Style TargetType="dxb:BarButtonItem">
            <Setter Property="BarItemDisplayMode" Value="Default"></Setter>
        </Style>
        <Style x:Key="ShortButtonStyle" TargetType="Button">
            <Setter Property="Width" Value="60"></Setter>
            <Setter Property="Margin" Value="0,0,4,0"></Setter>
        </Style>
        <Style x:Key="ButtonPanelStyle" TargetType="WrapPanel">
            <Setter Property="Margin" Value="0,4,8,12"></Setter>
            <Setter Property="HorizontalAlignment" Value="Right"></Setter>
        </Style>
        <Style x:Key="WindowStyle" TargetType="Window">
            <Setter Property="dx:ThemeManager.ThemeName" Value="None"></Setter>
        </Style>
        <Style x:Key="DialogStyle" TargetType="Window" BasedOn="{StaticResource ResourceKey=WindowStyle}">
            <Setter Property="ResizeMode" Value="NoResize"></Setter>
            <Setter Property="SizeToContent" Value="Height"></Setter>
        </Style>
        <Style x:Key="ReadOnlyListViewStyle" TargetType="dxg:TreeListView">
            <Setter Property="ShowRootIndent" Value="False"></Setter>
            <Setter Property="MultiSelectMode" Value="Row"></Setter>
            <Setter Property="AllowEditing" Value="False"></Setter>
            <Setter Property="NavigationStyle" Value="Row"></Setter>
        </Style>
    </ResourceDictionary>

    2.使用
    1)引入命名空间:

    2)控件上使用

  • 相关阅读:
    Dubbo (开源分布式服务框架)
    Springboot+Jpa的使用
    springboot(十二):springboot如何测试打包部署
    Java NIO:IO与NIO的区别
    eclipse下搭建shell脚本编辑器--安装开发shell的eclipse插件shelled
    spring boot
    【微服务架构】SpringCloud组件和概念介绍
    java正则表达式
    java的反射机制原理
    nginx代理服务器
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531655.html
Copyright © 2011-2022 走看看