上一页 1 2 3 4 5 6 ··· 19 下一页
摘要: 1 <Window x:Class="WPFdemo14.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/w 阅读全文
posted @ 2020-05-26 21:08 安以痕_陈 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 样式和资源字典能在一定范围上设置界面的属性效果,但是这些都是相对的是静态的,即使是动态的,也是先定义好的,无法直接按人的操作行为去设置效果。 这里来实现拖动功能,需要引用System.Windows.Interactivity.dll程序集 一,创建行为 1 using System; 2 usin 阅读全文
posted @ 2020-05-25 23:07 安以痕_陈 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 一、简单触发器 可为任何依赖项属性关联简单触发器。例如,可通过响应Control类的IsFocused、IsMouseOver以及IsPressed属性的变化,创建鼠标悬停效果和焦点效果。 1 <Window x:Class="WPFdemo12.MainWindow" 2 xmlns="http: 阅读全文
posted @ 2020-05-24 13:04 安以痕_陈 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 样式类似于BS的CSS 来设置控件的属性。 1,利用资源来设置 1 <Window x:Class="WPFdemo11.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x 阅读全文
posted @ 2020-05-23 21:41 安以痕_陈 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 建立资源字典 1 需要建立一个资源字典项 2 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/w 阅读全文
posted @ 2020-05-22 00:32 安以痕_陈 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 将已经定义好的资源,进行绑定,方便样式的更改。也分静态和动态资源。 静态资源加载一次在资源,资源变动后,不会更新绑定控件的资源。 动态资源,资源变动,绑定的控件资源也随着变动。 1 <Window x:Class="WPFdemo7.MainWindow" 2 xmlns="http://schem 阅读全文
posted @ 2020-05-21 22:19 安以痕_陈 阅读(174) 评论(0) 推荐(0) 编辑
摘要: <Window x:Class="WPFdemo6.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20 阅读全文
posted @ 2020-05-20 23:09 安以痕_陈 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 实现一个按钮背景随着List的颜色选项变色。 1 <Window x:Class="WPFdemo5.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://s 阅读全文
posted @ 2020-05-20 22:12 安以痕_陈 阅读(825) 评论(0) 推荐(1) 编辑
摘要: VisualTree就是对应WPF控件的可视元素的定义,下面来举例说明: 上面,我们通过了lable重写了button按钮的控件模板,我们还可以采用更复杂的控件来重写它: 运行后的效果效果就是上面的预览图,我们当然还可以构建更复杂的情况,WPF中基本上所有的控件,都可以定义控件模板。 上面的情况是我 阅读全文
posted @ 2020-05-19 21:45 安以痕_陈 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 文本控件 Label控件 label控件:一般用户描述性文字显示。 在Label控件使用时,一般给予用户提示。用法上没有什么很特殊的,label控件的值记住:不是Text 而是 Content属性。 TextBlock控件 TextBlock控件,是只读的文本框,无法进行编辑,比较适合显示文本,该文 阅读全文
posted @ 2020-05-19 21:41 安以痕_陈 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 19 下一页