上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: WPF 作为一个专门的展示层技术,让程序员专注于逻辑层,让展示层永远处于逻辑层的从属地位; 这主要因为有 DataBinding 和配套的 Dependency Property 和 DataTemplate; 1. 数据更新提醒 Binding 是一种自动机制,当属性的值变化后属性要有能力通知 B 阅读全文
posted @ 2021-02-24 18:56 鑫茂 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1. 前言 1. 数据驱动 UI WPF 是数据核心、主动的,UI 从属数据并表达数据、是被动的; 不再是 UI 驱动数据,而是数据驱动 UI; 2. 控件的定义 控件、数据内容、行为(控件响应用户操作执行自己的方法或以事件的形式通知应用程序); 1)控件是数据和行为的载体; 2)所以关注控件时应该 阅读全文
posted @ 2021-02-23 22:54 鑫茂 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 名称 种类(默认Attribute) 备注 x:Array 标记拓展 可作为 ListBox.ItemsSource 的值 x:Class 指定与 .cs 中哪个类合并,所指示的类型在声明时使用 partial 关键字 x:ClassModifier 指定标签编译生成的类具有怎样的访问控制级别,跟类 阅读全文
posted @ 2021-02-23 22:23 鑫茂 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Attribute 与 Property 之间的区别 Property 对应着抽象对象身上的性状; Attribute 是针对标签的特征; 往往一个标签具有的 Attribute 对于它所代表的对象的 Property。 1. 为对象属性赋值 1.1 使用标签的 Attribute 为对象属性赋值; 阅读全文
posted @ 2021-02-23 09:48 鑫茂 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 使用中介模式,大家通过往中介发消息,和从中介接受消息。从而避免了多个端之间的耦合。就像你看房,你不需要联系各个房东,你只需要联系中介,由中介去联系各个房东和各个租客。 abstract class Mediator { public abstract void Send(string message 阅读全文
posted @ 2020-12-27 22:20 鑫茂 阅读(95) 评论(0) 推荐(0) 编辑
摘要: graph LR client--调用-->Handler ConcreteHandlerA--继承-->Handler ConcreteHandlerB--继承-->Handler Handler--引用-->Handler 当 Handler 处理请求时,可以选择自己处理或调用继任者处理该请求。 阅读全文
posted @ 2020-12-27 22:18 鑫茂 阅读(52) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 烧烤的人 /// </summary> class Barbecuer { public void Meat() { Console.WriteLine("bbq meat"); } public void Vegetable() { Console.WriteL 阅读全文
posted @ 2020-12-27 22:15 鑫茂 阅读(63) 评论(0) 推荐(0) 编辑
摘要: // 硬件抽象类 abstract class HandsetBrand { // 硬件上安装的软件列表 protected IList<HandsetSoftware> _softwareList = new List<HandsetSoftware>(); public void AddSoft 阅读全文
posted @ 2020-12-27 22:12 鑫茂 阅读(72) 评论(0) 推荐(0) 编辑
摘要: class STWindow { static Window win; private STWindow() { } public static Window GetInstance() { if (win == null || !win.IsVisible) { win = new Window( 阅读全文
posted @ 2020-12-27 22:10 鑫茂 阅读(174) 评论(0) 推荐(1) 编辑
摘要: abstract class Component { protected string name; public Component(string name) { this.name = name; } public abstract void Add(Component c); public ab 阅读全文
posted @ 2020-12-27 22:09 鑫茂 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页