首页 > Windows开发 > 详细

C#小知识点集合

时间:2015-05-20 23:49:06      阅读:370      评论:0      收藏:0      [点我收藏+]

1.修改字体颜色

//修改字体颜色
SolidColorBrush brushred = new SolidColorBrush();//创建对象
brushred.Color = Colors.Red;//调用方法

2.注册事件和消息传递

Messenger.Default.Register<string>(this, "IsChange", TextColor);//注册事件 后
Messenger.Default.Send<string>(name, "IsChange");//消息传递 先

3.资源文件的字符串的两种情况

(1)cs类中读取资源文件的字符串

Properties.Resources.CurrentStr;
//(Properties.资源名称.字符串名称)

(2)xaml文件读取资源文件的字符串

{x:Static resx:Resources.CoolingConfStr}
// 需要在xaml文件中定义命名空间:
xmlns:resx="clr-namespace:name.Properties"

 

C#小知识点集合

原文:http://www.cnblogs.com/JoanLin-workNotes/p/4518360.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!