摘要: 一、依赖倒置原则 依赖于抽象类,依赖于接口,而非依赖于具体类的实现,这样方便子类的切换 Mytest mytest=new Mytest(); //依赖于具体类,硬编码 ITest mytest=new Mytest(); //依赖于接口 二、单一职责 在类中只做一件事,不会做其他不相关的事,或者跨 阅读全文
posted @ 2020-04-19 23:19 我瘦够了 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 模板能够更加灵活的控制控件的外观 1. 示例:通过模板更改控件Button的外观 效果: <Window x:Class="模板.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x 阅读全文
posted @ 2020-04-19 23:17 我瘦够了 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 样式是改变控件的基础方法 举例:改变三个Button的外观属性 XAML代码: <Window x:Class="样式.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="htt 阅读全文
posted @ 2020-04-19 23:16 我瘦够了 阅读(151) 评论(0) 推荐(0) 编辑