摘要:我们可以通过ItemTemplate设置ListBoxItem的显示模板,但是这样设置的模板有一个缺陷,那就是所有的Item都用同一个模板,所以的Item都千篇一律,有的时候我们是需要一点点变化的。在wpf中是支持DataTemplateSelector的,它可以根据条件为不同的Item选择不同的模板,于是我们就模拟实现一下DataTemplateSelector的功能。原理:ListBoxItem一般用ItemTemplate来定义item的展示方式,于是:1. 我们自定义一个ContentControl,名CityTemplateSelector,ItemTemplate就显示这个Cont
阅读全文
文章分类 - windows phone 7
摘要:This library adds extension methods to PhoneApplicationPage so you don't have to worry about maintaining the state of a page in your app if it gets tombstoned.It just takes 2 lines of code!protected override void OnNavigatingFrom(NavigatingCancelEventArgs e){ this.SaveState(e); // <- first li
阅读全文
摘要:一、注册edu.cn的账号。 学生账号,因此,邮箱的地址必须是以edu.cn结尾的。如果你学校里面有,可以自己去注册一个。如果你已经是毕业了,那么,到下面的地址去注册一个。 注册地址:http://post.usts.edu.cn/cgi-bin/vqregister/vqregister.cgi 注册号后登陆地址:http://post.usts.edu.cn/igenus/login.php 注册的方法不用介绍了吧。傻瓜式的。记住自己的邮箱地址和密码哦。这个以后有用。 二、注册开发者账号流程1. 登录注册网站,网址是http://create.msdn.com/en-US/home...
阅读全文
摘要:在Windows Phone 7 Tips (5) 中曾经提到,在Windows Phone 7 中页面的布局一般分为:Panoramic、Pivot、List和Full Screen。而通常List的实现方式就是ListBox。一、什么是ListBox?ListBox 是一个显示项集合的控件。一次可以显示 ListBox 中的多个项。ListBox继承自ItemsControl,可以使用Items或者ItemsSource设置其内容。二、在ListBox中显示数据我们可以通过两种方式在ListBox中显示:直接内嵌ListBoxItem(或其他UIElement,如TextBlock等) 与
阅读全文
摘要:To hide the left border:In Codeplex, download the Toolkit Source & Sample (under Other Available Downloads) and open the PhoneToolkit solutionIn the projectMicrosoft.Phone.Controls.Toolkit, open the folder named Themes, and edit Generic.xamlLook for this in Generic.xaml (should be at line 1522)&
阅读全文
摘要:【IT168 专稿】Silverlight是微软重要的RIA工具,可以广泛应用于网络应用开发领域和桌面领域。事实上,自Silverlight for Windows Phone 7登台以来,Silverlight已经吸引了越来越多的开发者。与其直接的竞争对手Flash一样,Silverlight自第一个版本问世以来,已为多线程计算提供广泛而丰富的支持。整体而言,在Silverlight中引入多线程的根本动机主要是为了解决用户体验中的响应速度,进而减少单线程带来的阻塞问题。 在本系列文章中,我想尽可能详细地总结Silverlight 4对于多线程编程技术的支持。其中提供的相关示例代码供读者朋友.
阅读全文
摘要:二进制文件一般被认为是一组序列字节。一般来说一个二进制文件可能包含任何形式的二进制编码的数据类型。例如:.mp3文件,.jpg文件,.db文件都可以看做二进制文件。本篇内容将以MP3文件为例。 首先创建一个Windows Phone 7项目,在项目中添加一个MP3文件例如“Battery_Low.mp3”,然后在MainPage.xaml.cs(或其他页面文件)中引入命名空间:1usingSystem.IO.IsolatedStorage;2usingSystem.IO;3usingSystem.Windows.Resources; 保存MP3文件到隔离存储空间 示例中首先检查文件是否...
阅读全文
摘要:In this post I am going to talk about how to access a Control inside the ListBox ItemPanelTemplate/DataTemplate in Silverlight for WP7.Question: How to access/modify a specific Control placed inside ListBox ItemTemplate/DataTemplate?When you have a data bound control, lets say for example ListBox we
阅读全文
摘要:Windows Phone 7虽然使用了silverlight的技术,但是并不是silverlight所有的控件对于Windows Phone 7都是适用的,同时Windows Phone 7也有一些Silverlight没有的控件。下面将简单介绍下:一、适用于Windows Phone 7的Silverlight控件在命名空间System.Windows.Controls下的以下控件适合于Windows Phone 7的开发。BorderButtonCanvasCheckBoxContentControlContentPresenterControlGridHyperlinkButtonIm
阅读全文
摘要:One of the new components in the November update of the Silverlight Toolkit for Windows Phone 7 is the AutoCompleteBox which shows suggestions in a drop-down, when the user types text into it. It is a control composed of a text box for text entry, a rich set of properties for customization and item
阅读全文
摘要:In this mini series "How to customize the WP7 ListBox Selected Item" of two posts I am going to demonstrate how to customize the ListBox Selected Item by modifying the ListBoxItem ControlTemplate as well as by changing the animations inside the Selected Visual State.How to customize the WP
阅读全文
摘要:使用自定义效果的listbox,比如点击效果和选项颜色,需要用Express Blend进行定制,包括动画都可以实现,下面是一些有关内容:To begin with lets first create a Windows Phone 7 application project , add a ListBox and some ListBoxItems. I will use the following code:<ListBox Height="200" VerticalAlignment="Top"> <ListBoxItem Con
阅读全文
摘要:是phone7中的浏览器控件,它是基于Internet Explorer7的,可以直接嵌入到应用程序中。这个控件相对于Windows mobile也有了许多的不同。另外这个控件与MediaElement 一样,只是一个基本显示窗口,所有的控制都需要自已来完成。如Forward、Backward、Refresh等。<phone:WebBrowser Grid.Row="1" HorizontalAlignment="Left" Name="webBrowser1" VerticalAlignment="Top"
阅读全文
摘要:The title of an application appears in the application list and on the application Tile when the user pins the application to the Start screen. Localizing the application title is optional. Some developers may want to not localize the application title for branding reasons.To localize the applicatio
阅读全文
摘要:介绍一下今天的实例,实例是调用一个汇率API(http://xurrency.com/)来实现货币转换,该API返回的就是JSON数据。但是免费用户使用该API有每天使用10次的限制,所以可能您在测试的时候返回错误,是因为达到了限制。解析与生成JSON需要System.Runtime.Serialization.Json命名空间,但得先从菜单添加引用”System.Runtime.Serialization”。Windows Phone 7上稍有不同,参考:Windows Phone 7解析Json实例 货币转换小程序源码下载代码:using System;using System.Colle
阅读全文
摘要:默认情况下,Visual Studio的ToolBox里没有任何下拉菜单的控件可供使用,虽然可以手工输入代码使用隐藏的ComboBox来实现下拉菜单,但是显示出来的菜单与Metro UI主题不匹配。Silverlight for Windows Phone Toolkit提供了多个系统默认没有的控件扩展,像AutoCompleteBox,ContextMenu,DatePicker,ListPicker等等,我们下载安装后就可以使用这些控件。要实现下拉菜单,用到了这里的ListPicker.下面详细介绍使用方法。首先,要下载安装Silverlight for Windows Phone Too
阅读全文
摘要:顺利解决textblock显示文字不完全的问题:There could be many scenarios when you'd need to be able to dipslay a text in your WP7 application which doesn't fit on the screen. The easiest way to approach to solvethis would be to utilize the ScrollViewer control as a host for a TextBlock. Something like that:<
阅读全文
摘要:课程介绍:Windows Phone7 是今年年初才推出的一个全新的移动平台,集成了微软Silverlight和XNA两大优势产品框架在里面,使这个平台与Windows mobile平台有了很大的区别,由于这种差别的存在,使应用开发也不同于以往的Windows mobile开发了。一起学Windows Phone7开发课程,对Windows Phone7各个功能模块开发都有所讨论,是一个由入门到深入的系列课程,是一个面向开发者和对Windows Phone感兴趣人士的课程,通过这个系列课程的学习,可以使您对Windows Phone7的开发有一个完整的认识,也为您进入更深层次的开发奠定了基础。
阅读全文
摘要:第一篇:Windows Phone 应用程序的全球化跟Silverlight做法一样,如果大家熟悉Silverlight的全球化,可以不看此文。本文一个具体的Demo介绍wp7应用程序如何实现本地化,并在本地化的一些注意点。 1. 创建windows phone 7 应用程序,命名为wp7Global 2. 右击项目,选择添加新项目,选择Resources File,命名为AppResource,如下图。点击确定 3. 假设我们程序的默认语言是英文的,则刚刚添加的资源文件就是我们程序默认的语言资源文件,右击项目wp7Global选择属性,打开属性页,点击Assembly Inform...
阅读全文
摘要:1. Windows Phone 7 Development for Absolute Beginners本套视频完全面向初学者,但是体系十分完整,从C#到XAML,从Silverlight到SDK应有尽有,有几十集之多,看完本套视频后绝对可以说是已经对Windows Phone 7入门了。由于集数过多,我就不一一列出了。点击这里或下面的图片都可以看到目录,按顺序学习即可,当然对于有基础的朋友你们也绝对可以从其中的某些部分中学到东西!2. Inside Windows Phone本套视频的内容颇具实战性,内容包括工具,控件,编程模型以及SDK。出自两位大牛Yochay Kiriaty和Jaim
阅读全文