摘要: string s = "test"; //Convert from string to byte[] //byte[] bytes = Convert.FromBase64String(s); byte[] bytes = Encoding.UTF8.GetBytes(s); //Convert f 阅读全文
posted @ 2016-09-05 17:56 Jane&Coding 阅读(327) 评论(0) 推荐(0)
摘要: MainWindow.xaml MainWindow.xaml.cs 阅读全文
posted @ 2016-08-03 10:12 Jane&Coding 阅读(190) 评论(0) 推荐(0)
摘要: App.xml.cs App.xml 阅读全文
posted @ 2016-08-03 09:56 Jane&Coding 阅读(355) 评论(0) 推荐(0)
摘要: 参考: http://www.codeproject.com/Articles/23731/RecentFileList-a-WPF-MRU 注意: 主要用到RecentFileList.cs文件。需要在Init(初始化)中添加点击Menu的事件处理方法;Open, Save和SaveAs中调用In 阅读全文
posted @ 2016-05-17 16:45 Jane&Coding 阅读(742) 评论(2) 推荐(0)
摘要: 与ListBox的ItemsSource为一个List<MyClass>, 但只想在ListBox中显示MyClass的属性MyName。 cs: this.ListBox1.ItemsSource = MyClassList; this.ListBox1.DisplayMemberPath = " 阅读全文
posted @ 2016-04-28 10:42 Jane&Coding 阅读(650) 评论(0) 推荐(0)
摘要: 当xaml中的一个element binding一个property时,出现PropertyChanged is null的原因(目前遇到的): 1. 没有设置将element(或上级)的DataContext。 2. Property不是public(血泪的教训)。 以后如遇到新情况会继续更新 阅读全文
posted @ 2016-04-27 15:17 Jane&Coding 阅读(2207) 评论(2) 推荐(1)
摘要: 因为当点击toolbar中button的时候textbox不会lost focus,也就不会更新binding的property。为了能在点击toolbar的时候访问property。 这样在修改textbox中内容的时候,property的值会实时更改。 阅读全文
posted @ 2016-04-25 15:47 Jane&Coding 阅读(2073) 评论(0) 推荐(0)
摘要: 想在textbox中字母与空格占用的宽度相同,需要设置 FontFamily="Courier New" 阅读全文
posted @ 2016-03-30 18:36 Jane&Coding 阅读(1175) 评论(0) 推荐(1)
摘要: 想在Listbox的SelectionChanged事件触发时对之前的选项进行处理。但是listbox没有previewSelectionChanged事件。 解决办法: 1. Validation 因为要处理的项在TextBox中,所以可以给TextBox添加一个Validation。但是由于Te 阅读全文
posted @ 2016-03-30 18:06 Jane&Coding 阅读(3874) 评论(0) 推荐(0)
摘要: 在textbox中输入内容,同时在listbox中高亮以目前textbox内容开头的项。 public String SearchText { get; set; } 阅读全文
posted @ 2016-03-29 14:49 Jane&Coding 阅读(670) 评论(0) 推荐(0)