全局 Style
2014-01-23 19:46
246 查看
1.定义一个全局资源文件,如下
2.使用
1)引入命名空间:
![](http://images.cnitblog.com/blog/35513/201401/231944289133.jpg)
2)控件上使用
<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)引入命名空间:
![](http://images.cnitblog.com/blog/35513/201401/231944289133.jpg)
2)控件上使用
![](http://images.cnitblog.com/blog/35513/201401/231945262726.jpg)
相关文章推荐
- [开发笔记]-C#获取pdf文档的页数
- MFC皮肤加载例子和皮肤使用方法
- HDU3836 Equivalent Sets 强联通分量 Tarjan
- 企业版IDP的申请及“In House”发布
- 几个名字的解释和理解:OLE,WebDAV
- Cocos2d-x 3.0 JNI BUG 修复。(Android 如何创建一个线程 延迟执行函数 创建一个随机数)
- 静态库的调用方法
- SVG画菱形
- 定义类
- Oracle SQL Trace 和 10046 事件
- linux下wget命令(下载文件命令)
- 二维码实现
- 解决LayoutItem lable 太长的问题
- 矩阵LU分解算法分析
- Hdu 1198 Farm Irrigation (DFS 异或的应用)
- GridControl 获取某分组的第一个孩子
- TreeListControl:设置行样式
- 软件质量控制
- Qt5.2中使用ping命令实现Ip扫描功能
- 《Java虚拟机规范》阅读(三):Class文件格式