摘要:
<Grid Margin="60"> <Grid.RowDefinitions> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition> <RowDefinition Height=" 阅读全文
posted @ 2017-12-31 18:24
Lulus
阅读(994)
评论(0)
推荐(0)
摘要:
管理控件状态和管理控件状态的转换逻辑 <Window.Resources> <Style TargetType="Button" x:Key="AnimatedStyle" > <Setter Property="Template"> <Setter.Value> <ControlTemplate 阅读全文
posted @ 2017-12-31 16:51
Lulus
阅读(1435)
评论(0)
推荐(1)
摘要:
类比command解决command参数限制问题 使用 在Blend中利用资产设置拖拽到下方目标空间 选中action,在设置中进行设置 例子 https://sshumakov.com/2012/10/22/how-to-create-and-use-actions-in-wpf/ 阅读全文
posted @ 2017-12-31 15:41
Lulus
阅读(987)
评论(0)
推荐(0)
摘要:
针对具有分层数据结构的控件设计的,比如说TreeView,相当于可以每一个层级上做DataTemplate XmlDataProvider:数据源,写在Resources下 <XmlDataProvider x:Key="Info" XPath="Nations"> <x:XData> <Natio 阅读全文
posted @ 2017-12-31 14:55
Lulus
阅读(525)
评论(0)
推荐(1)
摘要:
用以定义集合控件的容器外观,如ListBox,Combox 等等使用一个自定义的ListBox用以说明,其默认外观是上下排列,这里修改成横向排列 <Window.Resources> <DataTemplate x:Key="PersonDataTemplate"> <Grid> <Grid.Row 阅读全文
posted @ 2017-12-31 14:54
Lulus
阅读(1318)
评论(0)
推荐(3)
摘要:
DataTemplate作用是布局+数据绑定 使用DataTemplate 同时完成样式布局和数据绑定 <Window.Resources> <DataTemplate x:Key="PersonDataTemplate"> <Grid> <Grid.RowDefinitions> <RowDefi 阅读全文
posted @ 2017-12-31 14:53
Lulus
阅读(749)
评论(0)
推荐(1)
摘要:
ControlTemplate:外观定制 <Window.Resources> <ControlTemplate x:Key="CheckBoxControlTemplate" TargetType="CheckBox"> <StackPanel> <Rectangle Name="breakRec 阅读全文
posted @ 2017-12-31 14:52
Lulus
阅读(1153)
评论(0)
推荐(2)
摘要:
分类 ControlTemplate ItemsPanelTemplate DataTemplate 样式Style和模板Template对比 Style:样式,风格Template:模版,某种控件长什么样子Style依赖原始控件,对控件的已有属性进行改造Template天马行空,实现对控件颠覆式的 阅读全文
posted @ 2017-12-31 14:51
Lulus
阅读(2119)
评论(0)
推荐(3)
摘要:
新建资源文件 写资源文件 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa 阅读全文
posted @ 2017-12-31 11:50
Lulus
阅读(595)
评论(0)
推荐(1)
摘要:
第一种方式:瞄准控件的基类 如下例所示,继承ContentControl的控件,都可以使用这个Style <Window.Resources> <Style x:Key="ContentControlStyle" TargetType="ContentControl"> <Setter Proper 阅读全文
posted @ 2017-12-31 11:49
Lulus
阅读(511)
评论(0)
推荐(1)