随笔分类 - windows store Apps
Using Dispatcher
摘要:he following code example shows how you might attempt to update the UI from your task logic. // The Wrong Way to Update a UI Objectpublic void btnGetT
阅读全文
WPF的Binding学习笔记(二)
摘要:原文: http://www.cnblogs.com/pasoraku/archive/2012/10/25/2738428.htmlWPF的Binding学习笔记(二)上次学了点点Binding的皮毛, 然后就做别的事去了, 等回头再来看WPF的时候, 哈忘记了~于是写个例子补一下, 在继续学习B...
阅读全文
WPF的Binding学习笔记(一)
摘要:原文: http://www.cnblogs.com/pasoraku/archive/2012/10/20/2732427.html一、binding的一般步骤 1,准备数据源 数据源需要实现INotifyPropertyChanged接口 例如:class Person : INotifyP...
阅读全文
Azure: Destruct sample code for Mobile Service
只有注册用户登录后才能阅读该文。
转载:CancellationToken
摘要:http://www.cnblogs.com/Abbey/archive/2011/09/12/2174208.html最近在学习.NET中的线程同步。其中一个重要的技术叫线程的取消(中止),涉及的主要是一个叫CancellationToken的东西。通过学习,可以简单总结为:Token是一个令牌。...
阅读全文
Windows Store App, Shaken
摘要:Accelerometer _accelerometer; int _shakeCount = 0; public MainPage() { this.InitializeComponent(); _accelerometer=Accelerometer.GetDefault(); if (_accelerometer != null) _accelerometer.Shaken += new TypedEventHandler(Shaken...
阅读全文
Disable Portrait in app
摘要:I had this problem as well as I wanted to constrain my game to only landscape mode. I put this in my OnLaunched handler for App.xaml:Windows.Graphics.Display.DisplayProperties.AutoRotationPreferences=Windows.Graphics.Display.DisplayOrientations.Landscape;However I noted that in the simulator it seem
阅读全文
GridView of different size items
摘要:http://blogs.u2u.be/diederik/post/2012/03/07/Databinding-to-the-VariableSizedWrapGrid-in-Windows-8-Metro.aspx
阅读全文
Settings Pane in Charm
摘要:using Windows.UI.ApplicationSettings; Rect _windowBounds; double _settingsWidth = 364; Popup _settingsPopup; public MainPage() { this.InitializeComponent(); Windows.UI.ApplicationSettings.SettingsPane.GetForCurrentView().CommandsRequ...
阅读全文
GridView on Selection Changed
摘要:GridView中有两个事件分别是:gvSource_SelectionChanged 和gvSource_ItemClick。1. 若你设置了IsItemClickEnabled="True", 当你单击GridView里边的一个item时, gvSource_ItemClick事件会被触发。此时鼠标左键单击只是单击而不是选择。2. 相反你如此设置IsItemClickEnabled="False", 当你单击GridView里边的一个item时, 此时鼠标左键是选择, 所以gvSource_SelectionChanged会被执行而gvSource_
阅读全文
Animation in Windows 8 apps
摘要:在Windows 8 App里边的动画和在silverlight里边还有稍微的区别, 如代码:using Windows.UI.Xaml;using Windows.UI.Xaml.Media;using Windows.UI.Xaml.Media.Animation;using Windows.UI.Xaml.Controls; protected void DemoAnimation() { Duration m_Dur = new Duration(TimeSpan.FromSeconds(4)); Storyboa...
阅读全文
关于Windows Store App中的Globalization
摘要:前言: Gloablization, 全球化,本地化首先要在项目中创建strings 文件夹,然后在strings下边创建每一种语言代码的文件夹, 如en-us代表英语, zh-cn代表中文。其次向每一个文件夹下添加Resources.resw文件。在每一种语言的Resources.resw中添加要本地化的控件的名称和相关语言中的翻译。编写代码, 首先获取想要的语言, 根据语言来决定为PrimaryLanguageOverride赋值。 string language = string.Empty; string region = Windows.S...
阅读全文
Windows Store App窗口大小改动的事件
摘要:前言: Windows Store App, ApplicationViewState前几天一直纠结的一件事情就是我如何能够自己编程控制控件在不同ViewState中的设置, 搜寻网络发现这个触发器是Window.Current.SizeChanged。ApplicationViewState是一个枚举值, 有如下4个值:Windows.UI.ViewManagement.ApplicationViewState.FullScreenPortraitWindows.UI.ViewManagement.ApplicationViewState.SnappedWindows.UI.ViewMana
阅读全文
动态更新App Button的Style
摘要:在Windows 8 App中, App Button 的Style都是存储在资源文件中的, 系统自带的资源文件在Common folder下的StandardStyle.Xaml . 里边定义的Style是以健(Key)的形式表示和定义的。当我们在程序中动态改变一个App Button的Style是, 可以这么写: btPicture.Style = (Style)Application.Current.Resources["PicturesAppBarButtonStyle"];还有, 当你自定义一个Style时, 它所BasedOn的Style一定要写在其定义行之前.
阅读全文
App button alignment in BottomAppBar
摘要:Expected BottomeAppBar Style:For a long time, I have problem with the button alignment in bottomAppBar. If we have more than one buttons, I knew we need to add them to a stackpanel, and there only could be one stackpanel be added directly under <AppBar></AppBar>. Therefore if I want to l
阅读全文
Win 8 app 获取窗口的宽度和高度, 本地化, 及文本读取
摘要:在Windows 8的程序中:1. 获取用户窗口的宽高; double height = Windows.UI.Xaml.Window.Current.Bounds.Height; double width = Window.Current.Bounds.Width;2. 获取用户的语言设置; this._cultureInfo = System.Globalization.CultureInfo .CurrentUICulture .Name .ToString ();注释: 我现在还不清楚这个CurrentUICulture是怎么...
阅读全文
GridView.ScrollIntoView() doesn't work
摘要:I am writing an application which contains two pages, GroupedItemsPage and ItemDetailPage. I let lots of pictures present in the GroupItemsPage, then after select a specified picture in this page, it will nevigate the the second page withe the details showing for the selected picture. Since I put to
阅读全文
浙公网安备 33010602011771号