摘要: 今天遇到一个问题,需要把 打开的页面中 ,显示 其中 ListBox 的最后一项,试探着写了下面的代码,结果成功了,但是回头还需要研究一下,先记下来: static T FindChildOfType<T>(DependencyObject root) where T : class { var queue = new Queue<DependencyObject>(); queue.Enqueue(root); while (queue.Count > 0) { ... 阅读全文
posted @ 2012-01-12 16:22 博琼 阅读(302) 评论(0) 推荐(0)
摘要: 对于WP7中图形处理有关WriteableBitmap和BitmapImage之间的相互转换,给大家几个简单实用的方法。一、WriteableBitmap转为BitmapImage对象var bi= new BitmapImage(); bi.SetSource(wb.ToImage().ToStream()); //其中wb是WriteableBitmap对象。二、BitmapImage转为WriteableBitmap对象WriteableBitmap wb = new WriteableBitmap(bi.Source as BitmapSource); //这里就转换完成了三、将Wr. 阅读全文
posted @ 2011-12-22 14:41 博琼 阅读(855) 评论(0) 推荐(1)
摘要: /// <summary> /// 将SL的image保存到独立存储文件系统 /// TFSoft - 2011/06/07 /// </summary> /// <param name="ISFileName">独立存储文件名</param> /// <param name="SLImage">需要保存的图片源(Silverlihgt image 组件引用)</param> /// <returns>无错返回空串,出错返回出错信息</returns> pub 阅读全文
posted @ 2011-12-22 13:56 博琼 阅读(346) 评论(0) 推荐(0)
摘要: 今天和同事在 XNA 游戏中,在调试 Pushnotification 时,遇到了问题,在注册微软的云推送时,没有返回 ChannelUri。同事找到了解决方案:(1) 在 WMAppManifest.xml 文件中,在 <app> 节点中的 Publisher="" 中随便写入一段字符串,如 : Publisher ="OpenXLive" (2) 在<Capabilities> 中间添加 :s<Capability Name="ID_CAP_PUSH_NOTIFICATION" />之后再试,可 阅读全文
posted @ 2011-12-20 19:58 博琼 阅读(175) 评论(0) 推荐(0)
摘要: 16.1 概述 Windows Phone提供了XML、Isolated Storage、WebServices、 Cloud等数据访问方式,这一章我们来介绍Isolated Storage。另外我们我们将结合应用程序的生命周期介绍IsolatedStorageSettings,最后我们来说明一下Windows Phone对SDCARD的处理方式以及关于Isolated Storage的一个常见误解。16.2 IsolatedStorage Windows Phone 7都有自己的永久存储空间,叫做isolated storage,程序可以用过System.IO.IsolatedStorage 阅读全文
posted @ 2011-12-14 19:29 博琼 阅读(676) 评论(0) 推荐(0)
摘要: 1 using System.IO; 2 using System.Json; 3 using System.Runtime.Serialization; 4 using System.Runtime.Serialization.Json; 5 using System.Text; 6 using System.Windows; 7 using System.Windows.Controls; 8 using System.Xml.Serialization; 9 10 namespace SlSerialize 11 { 12 public partial cl... 阅读全文
posted @ 2011-12-14 17:40 博琼 阅读(647) 评论(0) 推荐(1)
摘要: C#与C++、Java之比较概览Ben Albahari 著 荣耀 译本文翻译时间较早。欢迎指出任何误失。谢谢。感谢以下人士的支持和反馈(按字母先后顺序):Don Box、C.R. Manning、Joe Nalewabau、John Osborn、Thomas Rhode、Daryl Richter。本文以C#提供的新编程方式以及它对两个近邻Java和C++的改进为中心。C#在很多方面采用和Java类似的方式来改进C++,因此,我不打算重复诸如单根对象层次优点之类的东西。正文以对C#和Java的相似点概述开始,然后着重探究C#的新特性。背景2000年6月,微软同时宣布了.NET平台和一个名. 阅读全文
posted @ 2011-11-24 13:17 博琼 阅读(895) 评论(0) 推荐(1)
摘要: 引用地址:http://msdn.microsoft.com/en-us/library/hh221552.aspx 阅读全文
posted @ 2011-11-23 17:23 博琼 阅读(161) 评论(0) 推荐(0)
摘要: One of the UI features of lists on Windows Phone 7 is that the "scroll bars" don't really act like traditional scroll bars; they are non-interactive and they only appear when the list is actually scrolling. To achieve this, the Silverlight team added a new visual state group that is us 阅读全文
posted @ 2011-11-21 13:56 博琼 阅读(293) 评论(0) 推荐(0)
摘要: private void MenuItem_Click(object sender, RoutedEventArgs e){ string header = (sender as MenuItem).Header.ToString(); ListBoxItem selectedListBoxItem = this.listBox.ItemContainerGenerator.ContainerFromItem((sender as MenuItem).DataContext) as ListBoxItem; if (selectedListBoxItem == null) { return; 阅读全文
posted @ 2011-11-20 17:04 博琼 阅读(657) 评论(0) 推荐(0)