摘要: 1.连接到 TCP 套接字服务器使用System.Net.SocketsAPI 创建一个套接字并连接到服务器。为了清楚起见,System.Net.SocketsAPI 的调用被封装在SocketClient类中。定义头(使用_socket变量存储Socket对象。_clientDone 变量是一个ManualResetEvent,用于协调通过SocketsAPI 调用的异步调用):// Cached Socket object that will be used by each call for the lifetime of this class Socket _socket ... 阅读全文
posted @ 2013-02-04 12:06 NSDefaultRunLoopMode 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 在开发Wpf/SL应用时,经常会遇到不同页面和窗体之间的参数传递的问题。对于这类问题,我们一般通过事件实现数据传递,也可以定义全局静态变量来进行数据共享。这里我们则使用了另外一种非常高效而优雅的方法来进行消息传递,这里我称之为Messenger,事实上,Messenger并非mvvm的专利,我们可以把它看作一种设计模式,你可以在其它.net程序中使用它。一、Mvvm Light Messenger是什么通过Mvvm Light源码我们可以知道Messenger的实现细节,如果你现在还不能理解这些代码也没关系,很多东西理解起来远比使用起来难,Messenger也是如此,它使用起来很简单,由于Me 阅读全文
posted @ 2013-01-23 09:54 NSDefaultRunLoopMode 阅读(375) 评论(1) 推荐(0) 编辑
摘要: Codeplex源码下载地址:https://sqlitewindowsphone.codeplex.com/releases1. 创建数据库第一步:新建Windows Phone应用程序,目标平台选择wpos 7.1(我给项目取名为TestSQLite)第二步:添加压缩包中 Community.CsharpSqlite.WP.dll 的引用: (引用,单击鼠标右键-->添加引用...)第三步: 添加四个按钮 : 注意命名(btnOpen创建并打开数据库 ,btnPopulate 创建表 ,btnClear 清空数据,btnClose,关闭连接)第四步: 添加对SQLite的引用:usi 阅读全文
posted @ 2013-01-18 17:16 NSDefaultRunLoopMode 阅读(334) 评论(0) 推荐(0) 编辑
摘要: You’ve heard me preach it before: fix those margins, align, and try and make your apps as beautiful and inspiring as you can (see also:my designer tips for developers).On Thursday, I stopped by the Windows Phone Design Team’s beautiful studio space here on campus. It’s a really creative space, packe 阅读全文
posted @ 2013-01-18 12:09 NSDefaultRunLoopMode 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Windows Phone 7内置了一个强大的网络浏览器,该浏览器的内核是基于桌面版的Internet Explorer 7(Mango版基于Internet Explorer 9,以下简称IE浏览器),并针对移动设备优化了网页排版引擎MSHTML,强化了多点触控等移动设备特性。在Windows Phone 7模拟器中已经内置了IE浏览器,如图3-23所示。图3-23就是一个在Windows Phone 7模拟器中的IE浏览器,该浏览器可以方便地浏览各种HTML网页,并全面支持JavasCript、Ajax等特性。Windows Phone 7中的浏览器虽然功能强大,但与Windows 桌面浏 阅读全文
posted @ 2013-01-17 20:26 NSDefaultRunLoopMode 阅读(360) 评论(0) 推荐(0) 编辑
摘要: WP7 Contrib is a set of components to help build WP7 Apps. It can be plugged into MVVM Light or used as separate components in your App. Our goal is to provide a set of tools and patterns that help WP7 developers.Now available via NuGet-http://nuget.org/List/Search?searchTerm=author%3A%20WP7ContribT 阅读全文
posted @ 2013-01-17 20:22 NSDefaultRunLoopMode 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 我在学习开发添加联系的时候,由于联系人很多,需要一个进度条,于是就使用了ProgressOverlay,我参照Codeplex代码写的,但是运行起来 那个进度条不显示,然后就自己写了一个TextBlock+ProgressBar,当然也很简单,今天我看到了解决方案,当然是看别人博客的,在这里分享给大家,呵呵:XAML代码:xmlns:Fun="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"xmlns:tookit="clr-namespace:Microsoft 阅读全文
posted @ 2013-01-17 20:04 NSDefaultRunLoopMode 阅读(247) 评论(1) 推荐(0) 编辑
摘要: This post is a preview of the Recipe for thePush Notification Server Side Helper Library. The library provides an easy way for sending all three kinds of push notification messages currently supported by Microsoft Push Notification Services (MPNS):Tile,Toast,andRaw. Our main goal here is to extract 阅读全文
posted @ 2013-01-17 19:59 NSDefaultRunLoopMode 阅读(475) 评论(1) 推荐(0) 编辑
摘要: Sterling数据库是一个NoSQL 面向对象的数据库产品,不仅可用于Silverlight for Desktop而且可用于Windows Phone上。最近在一个Windows Phone项目上选择了Sterling作为数据库,主要原因有二:1.支持Linq查询 2.功能全面使用Sterling进行数据存取操作,可参考其User Guide, 在实际项目遇到了一些问题,几个注意事项如下:1. 索引字段的值不能为null,否则保存时会遇到异常。这一点在User Guide中Index一节中没有提到,CodePlex上的disussion中提到了一个解决方法:在Index定义时指定默认值。例 阅读全文
posted @ 2013-01-17 17:29 NSDefaultRunLoopMode 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1.启动和关闭引擎 private void _ActivateEngine() { _engine = new SterlingEngine(); _logger = new SterlingDefaultLogger(SterlingLogLevel.Verbose); _engine.Activate(); Database = _engine.SterlingDatabase.RegisterDatabase<ItemsDatabaseInstance>(new Isol... 阅读全文
posted @ 2013-01-17 12:11 NSDefaultRunLoopMode 阅读(169) 评论(0) 推荐(0) 编辑