2012年2月16日
摘要: Note: This blog post will use the WCF RIA Services PDC Beta and VS2010 Preview, changes to the framework can me made before it hits RTM.Some questions that pops up about WCF RIA Services is how to enable transactions. So I decided to write a blog post about it, but to not make this post just a few . 阅读全文
posted @ 2012-02-16 11:34 xqiwei 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 在C#中,非主线程(即非UI线程,就是通过new Thread创建的线程)是不能直接操作UI元素的,Android中也一样,必须通过Handler与UI线程通讯,通知UI线程更新.而C#则采用委托的方式更新UI.下面用一个简单的实例来说明.这是一个WPF项目,只有一个名为textBlock1的TextBlock用于显示,一个名为button1的Button用于开启新线程来更新textBlock1.新线程执行的内容是0-100循环,而让textBlock1显示当前循环的进度.Windows Phone 7开发中,也通用,参考上代码:1234567891011121314151617181920. 阅读全文
posted @ 2012-02-16 11:19 xqiwei 阅读(2488) 评论(0) 推荐(0) 编辑
摘要: 一、委托Delegate一般的方法(Method)中,我们的参数总是string,int,DateTime...这些基本的数据类型(或者没有参数),比如Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->public void HelloWorld() { Console.WriteLine("Hello World!");}public void HelloWorld(string name) { Console.Write 阅读全文
posted @ 2012-02-16 11:17 xqiwei 阅读(270) 评论(0) 推荐(0) 编辑
  2010年9月6日
摘要: Ok, back to basics with this one.I have a collection of strings:1List<string> someStrings = new List<string>() { "aaaaaaa", "bbb", "ccc", "dddddddd" };And I want to remove the shorter item... 阅读全文
posted @ 2010-09-06 12:48 xqiwei 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Here’s a quick tip how to show linebreaks in a tooltip in xaml.I wanted to show properties on multiple lines (in a multibinding):01' 02<LABEL Content="{Binding Name}"> 03<LABEL.TOOLTIP&... 阅读全文
posted @ 2010-09-06 12:45 xqiwei 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Even though I seem to have gotten it right when I wrote about this in my book (I just checked) in my own memory I have had a misconception about GetObjectbyKey. I thought that GetObjectbyKey and TryGe... 阅读全文
posted @ 2010-09-06 12:39 xqiwei 阅读(299) 评论(0) 推荐(0) 编辑
摘要: When I want to fetch an entity, I normally have a method that uses a query. This method will always query the database and you will have an up-to-date entity.But if you need better performance perhaps... 阅读全文
posted @ 2010-09-06 12:37 xqiwei 阅读(512) 评论(0) 推荐(0) 编辑
  2010年1月27日
摘要: 问题:在利用Visual Studio 2005或2008集成开发工具进行开发的过程,对已开发完成的程序按“F5”试图进行编译运行,这时VS开发工具突然弹出“无法启动调试 绑定句柄无效”的错误信息,起初还以为VS开发工具安装太久了,随着“年龄”的增大出毛病了;还是先按自己的经验鼓捣了半天再按“F5”还是... 阅读全文
posted @ 2010-01-27 10:06 xqiwei 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 情况一string s = "Test";string t = string.Copy(s);Console.WriteLine(s == t); Console.WriteLine((object)s == (object)t);输出为true false情况二string s = "Test";string t = s;Console.WriteLine(s == t); Console.Wr... 阅读全文
posted @ 2010-01-27 10:01 xqiwei 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 提供一种将自定义逻辑应用于绑定的方式。命名空间: System.Windows.Data程序集: PresentationFramework(在 PresentationFramework.dll 中) 语法 Visual Basic(声明) Public Interface IValueConverterVisual Basic (用法) Dim instance As IValueConve... 阅读全文
posted @ 2010-01-27 09:55 xqiwei 阅读(1187) 评论(1) 推荐(0) 编辑