随笔分类 -  Windows Phone 攻略

开发令人激动的 Windows Phone
摘要:<Controls1:Pivot Grid.Row="1" ItemsSource="{Binding Items}" > <Controls1:Pivot.HeaderTemplate> <DataTemplate> <Grid> <TextBlock Margin="0,0,1,0" TextWrapping=... 阅读全文
posted @ 2012-04-28 12:14 博琼 阅读(535) 评论(0) 推荐(0)
摘要:部分WP7开发者可能对Operation not permitted on IsolatedStorageFileStream这个错误感到疑惑,有时候操作时主要是因为IsolatedStorage中没有相应的文件夹造成,同时对于程序内部的资源结构,这里Zune123给大家说明下: IsolatedStorageFile文件是保存在\Applications\Data\程序的GUID\Data\IsolatedStore这个文件夹下的。 IsolatedStorageSettings是保存在\Applications\Data\程序的GUID\Data\IsolatedStore\_... 阅读全文
posted @ 2012-04-28 10:15 博琼 阅读(344) 评论(0) 推荐(0)
摘要:才发现 IsHitTestVisible="False" 可以使控件不接收任何屏幕触控的手势,而是使手势向下传递。 阅读全文
posted @ 2012-04-26 16:46 博琼 阅读(776) 评论(0) 推荐(0)
摘要:Accelerometer sensor; private void ApplicationBarMenuItem_Click_2(object sender, EventArgs e) { //NavigationService.Navigate(new Uri("/Gyroscope_Test.xaml", UriKind.Relative)); sensor = new Accelerometer() { TimeBetweenUpdates = TimeSpan.FromSeconds(1) }; ... 阅读全文
posted @ 2012-04-26 11:10 博琼 阅读(275) 评论(0) 推荐(0)
摘要:首先定义模板: <DataTemplate x:Key="ItemTemplate"> <Grid Width="470" Margin="0,30,0,0" Tap="Grid_Tap" x:Name="grid"> <Grid.ColumnDefinitions> <ColumnDefinition Width="370"/> <ColumnDefinition Width="100"/> & 阅读全文
posted @ 2012-04-11 13:32 博琼 阅读(481) 评论(0) 推荐(0)
摘要:public MainPage() { InitializeComponent(); this.Loaded += new RoutedEventHandler(MainPage_Loaded); }void MainPage_Loaded(object sender, RoutedEventArgs e) {} 在页面加载过程中,第一次加载时 调用 构造函数,调用一次 Loaded 事件,但是,如果该页面始终在内存中时,当导航到该页面,构造函数不在调用,但是 Loaded 事件依然会调用。 阅读全文
posted @ 2012-04-05 18:21 博琼 阅读(364) 评论(0) 推荐(0)
摘要:1、首先引入 toolkit 命名空间:xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"2、在 app.xaml 文件中加入:<Style x:Key="SlideTransitionPageStyle" TargetType="phone:PhoneApplicationPage"> <Setter Property="toolkit:TransitionServ 阅读全文
posted @ 2012-04-05 17:37 博琼 阅读(558) 评论(0) 推荐(1)
摘要:设置grid 控件的附加属性:grid.SetValue(TiltEffect.IsTiltEnabledProperty , true);参考:http://www.windowsphonegeek.com/articles/Silverlight-for-WP7-Toolkit-TiltEffect-in-depth补充:首先需要设置父容器的 Effect 属性,把 Grid 项作为 xaml 页面中 ListBox 等容器的 ListboxItem1)在页面中引入:xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;ass 阅读全文
posted @ 2012-04-05 11:32 博琼 阅读(446) 评论(0) 推荐(0)
摘要:public partial class ViewComments_ExpanderPage : PhoneApplicationPage { ResourceDictionary dic = Application.Current.Resources; CallbackCommentData ccd; public ViewComments_ExpanderPage() { InitializeComponent(); this.Loaded += new RoutedEvent... 阅读全文
posted @ 2012-03-30 18:38 博琼 阅读(611) 评论(0) 推荐(0)
摘要:原文:http://www.ibeifeng.com/tech.php?id=62771dynamic 关键字和动态语言运行时 (DLR) 是 C# 4 和 Microsoft .NET Framework 4 中的重大新增功能。 这些功能在宣布时就引起了人们的极大兴趣,并伴随着许多疑问。 同时人们也给出了很多答案,但这些答案现在已散布于各种文档以及各种技术博客和文章之中。 这样,人们在各种论坛和会议上总是一遍又一遍地提出相同的问题。 本文全面概述了 C# 4 中新增的动态功能,并且深入探讨了这些功能如何同其他语言和框架功能(例如反射或隐式类型化变量)一起使用。 鉴于已有大量信息可用,我有时. 阅读全文
posted @ 2012-03-27 13:07 博琼 阅读(339) 评论(0) 推荐(0)
摘要:Windows Phone7中,我们查阅msdn首先得到的是System.Runtime.Serialization.Json空间下的DataContractJsonSerializer 类,没错,最简单最方便的就是微软自带的这个类.可以通过这个类轻松的将对象序列化为 JSON,或者将 JSON 数据反序列化为对象。但是这个类解析的时候有缺陷,后面的文章再提.话不多说,直接切入正题,使用方法:1.引入System.ServiceModel.Web.dll 2.using System.Runtime.Serialization.Json;3.代码部分: 1 internal static cl 阅读全文
posted @ 2012-03-27 12:41 博琼 阅读(700) 评论(0) 推荐(0)
摘要:1 public class CommonHelper 2 { 3 // 异常信息 4 string _exception = ""; 5 6 7 //#define APP_KEY @"c40fe2f61bcfd611177be71ec305196b" 8 //#define APP_SECRET @"5c585c08a597c23d" 9 10 //#define kSignUrl @"http://api.gozap.com/xauth/access... 阅读全文
posted @ 2012-03-26 18:00 博琼 阅读(572) 评论(0) 推荐(0)
摘要:因为默认在 Panorama 控件中,是不推荐使用 ApplicationBar 的,经过探索,研究了如下方法,并在 Panorama 控件需要的 Item中显示 ApplicationBar: ApplicationBar appBar; ApplicationBarIconButton btnAppBarRefresh; ApplicationBarIconButton btnAppBarSearch; ApplicationBarMenuItem menuItem1; ApplicationBarMenuItem me... 阅读全文
posted @ 2012-01-12 16:29 博琼 阅读(370) 评论(0) 推荐(0)
摘要:今天遇到一个问题,需要把 打开的页面中 ,显示 其中 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)
摘要:/// <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 博琼 阅读(174) 评论(0) 推荐(0)
摘要:引用地址: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 博琼 阅读(656) 评论(0) 推荐(0)
摘要:前些天自己做了一个在windows phone 7上的XNA 游戏,完成之后上传到 微软的 MarketPlace 上后,过了两天看到自己在 MarketPlace 上的操作面板提示认证失败,下载文档后,看到以下部分摘要:RequirementsWhen the user is already playing music on the phone when the application is launched, the application must not pause, resume, or stop the active music in the phone MediaQueue b. 阅读全文
posted @ 2011-11-09 08:14 博琼 阅读(616) 评论(3) 推荐(0)