摘要: 1.从hello world开始 #include <iostream> using namespace std; int main() { cout << "hello world" << endl; system("pause"); return EXIT_SUCCESS; } 解释:(1)#i 阅读全文
posted @ 2020-09-23 09:23 _MrZhu 阅读(105) 评论(0) 推荐(0)
摘要: 1.TemplatedParent:获取一个对此元素的模板父级的引用。 如果此元素不是通过模板创建而成,则此属性并不相关。 啥意思呢? 说再多不如实例形象,来看下面示例代码: 这是一个简单的ContentControl,它的Content是一个按钮,然后定义了控件模板和数据模板,代码中一些关键元素有 阅读全文
posted @ 2020-07-28 16:35 _MrZhu 阅读(660) 评论(0) 推荐(0)
摘要: 1.资源字典一般用法都是在一个工程项目中,新建一个Dictionary1.xaml文件,并定义资源样式,如下Dictionary1.xaml: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presen 阅读全文
posted @ 2020-07-22 10:49 _MrZhu 阅读(252) 评论(0) 推荐(1)
摘要: 1.列表样式 ItemContainerStyle (1)单选列表: 前台xaml: <ListBox ItemsSource="{Binding Products}" Name="listbox" DisplayMemberPath="Name"> </ListBox> 后台代码: using S 阅读全文
posted @ 2020-07-14 15:16 _MrZhu 阅读(146) 评论(0) 推荐(0)
摘要: 数据转换stringFormat <Window x:Class="WpfApplicationDEMO.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sch 阅读全文
posted @ 2020-07-13 14:36 _MrZhu 阅读(106) 评论(0) 推荐(0)
摘要: ObjectDataProvider (1)基本使用 这个ObjectDataProvider东西真的是个神奇的存在。等同于反射。只不过是写在xaml中。 例如说我要把colors中所有的颜色列举出来: 普通方法: //CB是combobox this.CB.ItemsSource = typeof 阅读全文
posted @ 2020-07-07 13:15 _MrZhu 阅读(210) 评论(0) 推荐(0)
摘要: 前台xaml样式: <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="True"> <Setter Property="BorderBrush" 阅读全文
posted @ 2020-07-02 13:23 _MrZhu 阅读(275) 评论(0) 推荐(0)
摘要: 1.数据库辅助类 using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tas 阅读全文
posted @ 2020-05-22 10:13 _MrZhu 阅读(580) 评论(0) 推荐(0)
摘要: using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespac 阅读全文
posted @ 2020-05-19 15:54 _MrZhu 阅读(228) 评论(0) 推荐(0)
摘要: 转载自https://www.cnblogs.com/tcjiaan/p/5700192.html 自定义实现两个对象的相等比较,一种方案是重写Object类的Equals方法,很easy,如果相等返回true,不相等就返回false。不过,如果把自定义相等的比较用于泛型集,比如Dictionary 阅读全文
posted @ 2020-05-19 10:34 _MrZhu 阅读(289) 评论(0) 推荐(0)