摘要: 前几天有个网友问我如果动态绑定Pivot项,即PiovtItem的项是动态的,PivotItem中的数据也是动态的。这个使用MVVM模式可以很方便的实现,在ViewModel中设置一个集合表示当前有多少个Item,集合中的类中含有当前PivotItem中的数据源。下面以一个简单的demo来演示下: 先来看看XAML中是怎么去绑定的 阅读全文
posted @ 2011-11-20 07:44 Alexis 阅读(4427) 评论(10) 推荐(3) 编辑
摘要: 在之前的文章中,我讲到了一些关于Windows Phone中处理图片的知识,Windows Phone 中编辑图片 、Windows Phone 中处理图片的技巧 、在Windows Phone显示GIF图片 、保存图片及加载图片 ,可以看出图片处理在Windows Phone 开发中占了比较大的比例,今天我介绍一个简单的图片缓存机制。 David Anson 发表一个LowProfileImageLoader , 用来下载图片而不影响UI线程(Mango中已经将图片处理从UI线程中抽离处理了,所以不会有这个影响,大家也可以参考这篇文章). 阅读全文
posted @ 2011-11-17 21:21 Alexis 阅读(4968) 评论(11) 推荐(8) 编辑
摘要: I have talked about how to create custom Live Tile in 《Windows Phone 实用开发技巧(17):自定义应用程序的Tile》. Today let’s dig a little bit deeper. What do you see in this image shown below ? 阅读全文
posted @ 2011-11-01 20:51 Alexis 阅读(3746) 评论(12) 推荐(3) 编辑
摘要: 有些时候我们需要对ListBox中的某项做出一种点击动画,即点击ListBox的某项时,被点的Item播放一个相应的动画。通常,我们需要自定义ListBox的ItemTemplate以做出自定义的ListBoxItem。下面,我讲讲如何利用Expression Blend和Visual Studio 分别实现这样的效果。 阅读全文
posted @ 2011-10-15 13:28 Alexis 阅读(2473) 评论(1) 推荐(4) 编辑
摘要: During windows phone development, sometimes we might be want to read some initial data from local resources. Data can be stored in XML, JSON, TXT or other formats. Unlike data files stored in Isolatedstorage, we cannot make changes to them or delete them (since they are built in Content or Resource). Which format is better ? Well, it depends. So let me make a simple demo to show you how we read initial data in wi 阅读全文
posted @ 2011-10-15 09:19 Alexis 阅读(2543) 评论(8) 推荐(6) 编辑
摘要: In my last post《Windows Phone 实用开发技巧(22):使用日志记录当前信息与异常信息》 , I talked about how to log in our application. Here comes the problem: how can we get the log file. If we run application locally, we can use ISETool to get files stored in IsolatedStorage. But since app users are far away from you. We cannot go to somebody and say “Hey, can I use your phone to get my log back…bala..bala..” We can make a button that is u 阅读全文
posted @ 2011-10-10 20:24 Alexis 阅读(2411) 评论(7) 推荐(2) 编辑
摘要: 在之前的《Windows Phone 实用开发技巧(14):输入框隐藏SIP事件》中,我讲了如何在Windows Phone 中检测点击物理回退键的时候,SIP会自动隐藏的事件,那么如果我们想在Windows Phone页面中隐藏强制SIP,比如说我们已经在文本框中输入一些文本,这时候我们点击Appbar,我们想让SIP隐藏后页面进行跳转或者GoBack,这时候我们应该怎么做呢? 阅读全文
posted @ 2011-10-10 11:04 Alexis 阅读(1706) 评论(3) 推荐(1) 编辑
摘要: 不知道上一个项目实战《Windows Phone 项目实战之账户助手》 大家学会创建自己的Windows Phone 应用程序没有?今天为大家带来另一个涉及网络的项目实战:我的微盘。涉及的技术知识点有: Json、Network、本地上传文件、SDK、Hammock、微盘 用过新浪微博的朋友肯定很喜欢微盘 ,我们可以存储的文件并且与朋友分享,而且下载不需要任何积分(这点很重要,哈哈). 目前国内的网盘只有微盘是提供API给开发者的,我们可以自己写App来操作微盘,微盘的API地址为:http://vdisk.me/api (需要注册后才能查看)。 阅读全文
posted @ 2011-10-06 12:39 Alexis 阅读(9560) 评论(60) 推荐(21) 编辑
摘要: 1. 在mango中新增了下列启动器与选择器 Address Chooser Task、Bing Maps Task、Bing Maps Directions Task、Game Invite Task、Save Contact Task、Save Ringtone Task、Share Link Task、Share Status Task 2. Scheduled 任务和后台代理允许应用程序可以在后台执行代码,甚至这个应用程序没有在前台运行。Scheduled 任务有两种类型:PeriodicTask和ResourceIntensiveTask。 一个应用程序最多只能有一个后台代理。 3. Periodic代理和resource-intensive代理在运行的时候不能消耗内存超过6M,而Audio代理则限制为15M。一旦超出这个内存限制,这些代理都会立即被终止。 阅读全文
posted @ 2011-09-24 21:42 Alexis 阅读(2257) 评论(7) 推荐(3) 编辑
摘要: What is logging ? Logging is the felling, skidding, on-site processing, and loading of trees or logs onto trucks. And since windows phone is much more event driven. you can find more information in Event Logging. Why to use logging ? Exception is everywhere in common software development. A good logging tool may helps a lot in solving problems. Here I recommend logging tool in WP7Contr 阅读全文
posted @ 2011-09-23 06:43 Alexis 阅读(2492) 评论(14) 推荐(2) 编辑
摘要: 今天很高兴在快乐技术沙龙中分享了我做账户助手时的一些经验教训,总结了7条比较有意思的实战技巧。 可能今天有些朋友对Windows Phone 手机开发不怎么熟悉,听我讲的东西可能有些吃力,在这里表示抱歉。Anyway, AccountHelper是一个很好的练手项目。 涉及到的知识点有: 1.使用MVVMLight框架 阅读全文
posted @ 2011-09-17 19:40 Alexis 阅读(2072) 评论(29) 推荐(2) 编辑
摘要: In Windows Phone Mango update, we can use VideoBrush since we could not do that in windows phone 7 . So there is something interesting to do. We can develop more fantasitic apps. For example, we can play a video as background in our application. We want to play video in a loop also. But here comes the problem. Since there is no MediaTimeline in Silverlight for Windows Phone API. How can we repeat media playbac 阅读全文
posted @ 2011-09-10 11:09 Alexis 阅读(2012) 评论(6) 推荐(3) 编辑
摘要: Windows Phone 实用开发技巧记录了我平时遇到的问题以及相应的处理方法,记录下来以自己后面查看,也希望其他朋友能够尽量少走弯路,不要一个bug调半天。 将这些开发技巧整理为一电子书与大家共享: 阅读全文
posted @ 2011-09-08 07:17 Alexis 阅读(6476) 评论(69) 推荐(49) 编辑
摘要: 我们知道Windows Phone 中ApplicationBar的Text属性不是依赖属性,不能采取绑定的方法实现文本的国际化,那么我们在实际开发中是怎么实现ApplicationBar的文本多语言的呢?有如下几种方法: 1. 在后置代码中生成AppBar,文本使用资源文件 这种方法是最简单的方法,就是在将XAML代码翻译为C#代码,其中的一个好处就是Text可以国际化。 2. 使用静态资源 这个方法类似于样式,即Text={"StaticResource Appbar_Save"}的形式。实现的 阅读全文
posted @ 2011-09-07 21:39 Alexis 阅读(2352) 评论(5) 推荐(3) 编辑
摘要: 在上篇开发技巧《Windows Phone 实用开发技巧(18):使用SystemTray显示全局消息提醒》 中介绍了Mango中新增的API ProgressIndicator的使用,以两个小Demo展示了它的作用,其实还有一个非常实用的属性IsIndeterminate可以用来显示正在busy的状态。 用过mango真机的童鞋有没有注意到,短信界面中可以登录当前的MSN,上面的状态显示条就是使用的 ProgressIndicator。 还有Office中的"Getting your document from skydrive"也是使用的ProgressIndicator。可见ProgressIndicator是一个显示当前状态很好的途径。 阅读全文
posted @ 2011-09-04 08:15 Alexis 阅读(5664) 评论(7) 推荐(3) 编辑
摘要: 在之前的《Windows Phone 项目实战之账户助手》中介绍了如何创建一个实实在在的Windows Phone 应用程序,包括开始的需求分析、概要设计以及编码实现,由于篇幅及精力有限,未太多讲解如何具体实现,只是给大家一个大致的思路。 Windows Phone 最新的开发工具Mango Beta2 发布已经有一阵子了,于是利用业余时间将AccountHelper也升级美化了下(PS:拖的时间有点长了,呵呵)。具体利用到Mango中的新特性的有如下几点: 阅读全文
posted @ 2011-08-21 11:46 Alexis 阅读(2491) 评论(12) 推荐(3) 编辑
摘要: 在Windows Phone 7 (Nodo)之前的版本中,我们要在应用程序显示消息提醒,或者是进度提示,通常的做法在页面的顶部放置一个专门的容器(如一个Grid),里面防止一些文本和PerformanceProgressBar。 在Mango中,我们多了一种选择,就是可以咋SystemTray中显示文本和进度条。如下图,SystemTray即显示系统信息的状态栏,有当前的信号,电量,时间等等。 阅读全文
posted @ 2011-08-20 13:41 Alexis 阅读(3916) 评论(14) 推荐(10) 编辑
摘要: 在Windows Phone 7 (Nodo)之前的版本中,我们在应用程序列表中长按某个应用程序的时候,会弹出“Pin To Start”的选择,选中后系统会将该应用程序的快捷方式Pin到启动界面中,类似于Windows 上的桌面快捷方式。那时候呈现在启动界面的图片是应用程序中的Background.png,如果你没有改变该变片的话,Pin到Start中的图片大致如下: 阅读全文
posted @ 2011-08-19 21:33 Alexis 阅读(3299) 评论(17) 推荐(6) 编辑
摘要: 一说到编辑图片,大家可能会想到将图片拆分成一个个像素,然后去操作这些像素,从而达到编辑图片的目的。今天介绍一个比较好用的类,WriteableBitmap,一个可以将UI元素保存为图片的类,也可以对UI元素进行转变后进行保存。OK,下面开始Demo吧: 阅读全文
posted @ 2011-07-22 17:08 Alexis 阅读(3230) 评论(12) 推荐(2) 编辑
摘要: 在做其他平台,无论是WinForm、WPF、Silverlight还是Asp.Net,大家可能都会遇到这样的需求:输入框只能输入数字。其实实现方式都大同小异,获取输入文字的key,判断其是否是可以输入的范围。下面讲一下,如何在windows phone 下让输入框只能输入数字。 阅读全文
posted @ 2011-07-12 18:50 Alexis 阅读(3467) 评论(12) 推荐(2) 编辑
摘要: 在Windows Phone 中,当输入框获得焦点的时候,Soft Input Panel(SIP)会自动显示出来以让用户输入。此时我们点击物理回退键的时候,SIP会自动隐藏。那么这个是触发了什么事件呢?如果我们想做一些其他的操作应该在哪里编写Code呢? 我们可以注册输入框的KeyUp事件,当输入框获得焦点点击回退按钮的时候,系统做了两件事情:隐藏SIP、输入框失去焦点。 阅读全文
posted @ 2011-07-09 07:13 Alexis 阅读(2310) 评论(1) 推荐(4) 编辑
摘要: 阅读本文你将会了解如何一步步创建一个Windows Phone 应用程序,包括软件工程的一般流程。 阅读全文
posted @ 2011-07-02 12:01 Alexis 阅读(8876) 评论(64) 推荐(20) 编辑
摘要: 在Silverlight for Windows Phone 中,绑定是一个很重要的概念,如果你的绑定用好了,将会节省很多事情... 如下图,Button2的高度是Button1 的高度+400. 阅读全文
posted @ 2011-06-29 20:21 Alexis 阅读(1879) 评论(5) 推荐(1) 编辑
摘要: 用过Windows Phone真机的童鞋应该都很喜欢Windows Phone自带的动画效果,如首页的瓷片掀起效果、播放音乐处的动画等等。国外牛人Colin Eberhardt 《Metro In Motion》系列教你如何在windows phone实现Metro效果。 阅读全文
posted @ 2011-06-26 19:29 Alexis 阅读(2364) 评论(8) 推荐(4) 编辑
摘要: 教你如何让StackPanel靠右对齐进行布局 阅读全文
posted @ 2011-06-26 08:21 Alexis 阅读(6876) 评论(4) 推荐(1) 编辑