Windows8 LoadMoreItemsOverride

摘要: // This class implements IncrementalLoadingBase. // To create your own Infinite List, you can create a class like this one that doesn't have 'generator' or 'maxcount', // and instead downloads items from a live data source in LoadMoreItemsOverrideAsync. public class GeneratorIncr 阅读全文
posted @ 2013-03-28 10:19 JackSlaterYu 阅读(386) 评论(0) 推荐(0) 编辑

Windows8 ApplicationData

摘要: ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings; StorageFolder roamingFolder = Windows.Storage.ApplicationData.Current.RoamingFolder; public MainPage() { this.InitializeComponent(); //Set Simple setting ... 阅读全文
posted @ 2013-03-28 09:51 JackSlaterYu 阅读(221) 评论(0) 推荐(0) 编辑

Windows8 全球资源化

摘要: <Page x:Class="Metro全球化资源.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:Metro全球化资源" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 阅读全文
posted @ 2013-03-28 09:37 JackSlaterYu 阅读(210) 评论(0) 推荐(0) 编辑

Windows8 StreamSocket Client

摘要: private StreamSocket clientSocket = new StreamSocket(); private HostName serverHost; private string serverHostnameString; private string serverPort; private bool connected = false; private async void Connect_Click(object sender, RoutedEventArgs e) { ... 阅读全文
posted @ 2013-03-28 09:30 JackSlaterYu 阅读(265) 评论(0) 推荐(0) 编辑

Windows8 StreamSocket Server

摘要: private StreamSocket socket; private bool connected = false; private async void StartListener_Click(object sender, RoutedEventArgs e) { StreamSocketListener listener = new StreamSocketListener(); listener.ConnectionReceived += OnConnection; ... 阅读全文
posted @ 2013-03-28 09:06 JackSlaterYu 阅读(241) 评论(0) 推荐(0) 编辑

Windows8 Search Contract

摘要: //Search Contract private static int SearchPaneMaxSuggestions = 5; private SearchPane searchPane = SearchPane.GetForCurrentView(); protected override void OnNavigatedTo(NavigationEventArgs e) { searchPane.SuggestionsRequested += new TypedEventHandler(OnSearchP... 阅读全文
posted @ 2013-03-27 11:46 JackSlaterYu 阅读(271) 评论(0) 推荐(0) 编辑

Windows8 载入XML文件

摘要: public async Task LoadXmlFile(String folder, String file) { StorageFolder storageFolder = await Package.Current.InstalledLocation.GetFolderAsync(folder); StorageFile storageFile = await storageFolder.GetFileAsync(file); XmlLoadSettings loadSettings = new XmlLo... 阅读全文
posted @ 2013-03-27 11:44 JackSlaterYu 阅读(185) 评论(0) 推荐(0) 编辑

Windows8 FileOpenPicker && FolderPicker

摘要: private async void PickAFileButton_Click(object sender, RoutedEventArgs e) { FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.List; openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; o... 阅读全文
posted @ 2013-03-27 11:20 JackSlaterYu 阅读(284) 评论(0) 推荐(0) 编辑

合并ResourceDictionary

摘要: <!--合并资源到资源集合中--> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="MyResource.xaml"/> <ResourceDictionary Source="MyResource1.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceD... 阅读全文
posted @ 2013-03-27 11:11 JackSlaterYu 阅读(89) 评论(0) 推荐(0) 编辑

自定义 DependencyProperty 与 RoutedEvent

摘要: //自定义依赖属性 class MyBook : DependencyObject//依赖属性必须派生自DependencyObject { public static readonly DependencyProperty BookNameProperty = DependencyProperty.Register("BookName", typeof(string), typeof(MyBook));//依赖属性必须是静态的DependencyObject对象 public string BookName { ... 阅读全文
posted @ 2013-03-27 11:08 JackSlaterYu 阅读(274) 评论(0) 推荐(0) 编辑