2019年5月23日

wpf防止界面卡死

摘要: 1 AsyncInvokeHelper.CallbackInvoke(new Action(() => 2 { 3 System.Threading.Tasks.Task.Factory.StartNew(() => 4 { 5 6 ... 阅读全文

posted @ 2019-05-23 18:48 Shine-Zhong 阅读(1412) 评论(2) 推荐(0) 编辑

2019年4月8日

wpf 加阴影效果导致内容模糊的问题解决

摘要: 这个和GPU有关,参考地址 https://www.cplotts.com/2009/02/25/gpu-effects-blurry-text/ 产生问题的代码如下: 解决问题的代码如下: 阅读全文

posted @ 2019-04-08 17:28 Shine-Zhong 阅读(652) 评论(0) 推荐(1) 编辑

2019年4月2日

WPF 绑定 验证

摘要: <TextBox Grid.Column="1" Margin="1" Text="{Binding Name, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}" />在属性setter方法中校验时出现错误,就会出现一 阅读全文

posted @ 2019-04-02 17:56 Shine-Zhong 阅读(127) 评论(0) 推荐(0) 编辑

2019年2月25日

关于Newtonsoft.Json,反序列化jason,内容有key的转换

摘要: Newtonsoft.Json,反序列化,对于result里面的结果,可以使用Dictionary<string, List<类名>>,string是key值,value又是一个实体类集合 阅读全文

posted @ 2019-02-25 15:33 Shine-Zhong 阅读(449) 评论(0) 推荐(0) 编辑

2018年11月29日

读取本地图片 BitmapImage

摘要: BitmapImage defImage = new BitmapImage(); defImage.BeginInit(); defImage.UriSource = new Uri(@"H:\xxxx\xxxxx\xxxxxxxx\38dbb6fd5266d0163b0d0bd49c2bd407 阅读全文

posted @ 2018-11-29 10:16 Shine-Zhong 阅读(380) 评论(0) 推荐(0) 编辑

2018年10月31日

wpf让图片自适应容器大小,而且又不会拉升变形

摘要: 1 4 5 9 10 阅读全文

posted @ 2018-10-31 17:44 Shine-Zhong 阅读(6087) 评论(0) 推荐(2) 编辑

2018年9月21日

wpf 用户自定义事件传参2

摘要: public delegate void MenuButtonClickEventHandler(object sender, EventArgs e); public event MenuButtonClickEventHandler MenuButtonClick { add { ... 阅读全文

posted @ 2018-09-21 15:13 Shine-Zhong 阅读(558) 评论(0) 推荐(0) 编辑

2018年7月5日

wpf Assembly.LoadFile dll GetType 反射 抛异常 不具有由 URI 识别的资源。

摘要: public static void LoadViewFromUri(this Window window, string baseUri) { try { var resourceLocater = new Uri(baseUri, UriKind.Relative); ... 阅读全文

posted @ 2018-07-05 14:33 Shine-Zhong 阅读(868) 评论(0) 推荐(0) 编辑

2018年7月4日

listbox或datagrid内容双击事件绑定

摘要: listbox <DataTemplate> <Border Width="350" Height="230" Margin="2" Background="{DynamicResource Common.UC.Background.Dark}"> <Border.InputBindings>//绑 阅读全文

posted @ 2018-07-04 17:03 Shine-Zhong 阅读(165) 评论(0) 推荐(0) 编辑

2018年4月23日

wpf 自定义属性的默认值

摘要: public int MaxSelectCount { get { return (int)GetValue(MaxSelectCountProperty); } set { SetValue(MaxSelectCountProperty, value); txtMaxCount.Text = va 阅读全文

posted @ 2018-04-23 13:51 Shine-Zhong 阅读(650) 评论(0) 推荐(0) 编辑

导航