protected override void OnNavigatedTo(NavigationEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (e.Parameter.GetType() == typeof(ItemListViewModels)) { this.ViewModel = (ItemListViewModels)(e.Parameter); } if (e.NavigationMode == NavigationMode.New) { ApplicationData.Current.LocalSettings.Values.Remove("TheWorkInProgress"); } else { if (ApplicationData.Current.LocalSettings.Values.ContainsKey("TheWorkInProgress")) { var composite = ApplicationData.Current.LocalSettings.Values["TheWorkInProgress"] as ApplicationDataCompositeValue; TitleTextBox.Text = (string)composite["Title"]; DetailTextBox.Text = (string)composite["Detail"]; Datepicker.Date = Convert.ToDateTime((string)composite["Date"]); LineCheckBox.IsChecked = (bool)composite["Check1"]; LineCheckBox2.IsChecked = (bool)composite["Check2"]; ApplicationData.Current.LocalSettings.Values.Remove("TheWorkInProgress"); } } }
public MainPage() { this.InitializeComponent(); this.ViewModel = new ItemListViewModels(); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(4); timer.Tick += (x, y) => { var updater = TileUpdateManager.CreateTileUpdaterForApplication(); TileNotification notification; var item = ViewModel.AllItems.ElementAt(ItemIndex); var xmlDoc = TileService.CreateTiles(new PrimaryTile(item.title, item.detail, item.date)); notification = new TileNotification(xmlDoc); updater.Update(notification); ItemIndex = (ItemIndex + 1) % ViewModel.AllItems.Count; }; timer.Start(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (e.Parameter.GetType() == typeof(ItemListViewModels)) { this.ViewModel = (ItemListViewModels)(e.Parameter); } }
//public void DisPlayTile() //{ // var updater = TileUpdateManager.CreateTileUpdaterForApplication(); // TileNotification notification; // var item = ViewModel.AllItems.ElementAt(ItemIndex); // var xmlDoc = TileService.CreateTiles(new PrimaryTile(item.title, item.detail, item.date)); // notification = new TileNotification(xmlDoc); // updater.Update(notification); // ItemIndex = (ItemIndex + 1) % ViewModel.AllItems.Count; //} protected override void OnNavigatedTo(NavigationEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (e.Parameter.GetType() == typeof(ItemListViewModels)) { this.ViewModel = (ItemListViewModels)(e.Parameter); } DataTransferManager.GetForCurrentView().DataRequested += OnShareDataRequested; }
//public void DisPlayTile() //{ // var updater = TileUpdateManager.CreateTileUpdaterForApplication(); // TileNotification notification; // var item = ViewModel.AllItems.ElementAt(ItemIndex); // var xmlDoc = TileService.CreateTiles(new PrimaryTile(item.title, item.detail, item.date)); // notification = new TileNotification(xmlDoc); // updater.Update(notification); // ItemIndex = (ItemIndex + 1) % ViewModel.AllItems.Count; //} protected async override void OnNavigatedTo(NavigationEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; if (e.Parameter.GetType() == typeof(ItemListViewModels)) { this.ViewModel = (ItemListViewModels)(e.Parameter); } if (e.NavigationMode == NavigationMode.New) { ApplicationData.Current.LocalSettings.Values.Remove("TheWorkInProgress"); } else { if (ApplicationData.Current.LocalSettings.Values.ContainsKey("TheWorkInProgres" + "s")) { var composite = ApplicationData.Current.LocalSettings.Values["TheWorkInProgress"] as ApplicationDataCompositeValue; TitleTextBox.Text = (string)composite["Title"]; DetailTextBox.Text = (string)composite["Detail"]; Datepicker.Date = Convert.ToDateTime((string)composite["Date"]); StorageFile theFile = await StorageApplicationPermissions.FutureAccessList.GetFileAsync((string)ApplicationData.Current.LocalSettings.Values["MyToken"]); BitmapImage srcImage = new BitmapImage(); if (theFile != null) { ApplicationData.Current.LocalSettings.Values["MyToken"] = StorageApplicationPermissions.FutureAccessList.Add(theFile); using (IRandomAccessStream stream = await theFile.OpenAsync(FileAccessMode.Read)) { await srcImage.SetSourceAsync(stream); this.Image.Source = srcImage; } } ApplicationData.Current.LocalSettings.Values.Remove("TheWorkInProgress"); } } DataTransferManager.GetForCurrentView().DataRequested += OnShareDataRequested; }
public MainPage() { this.InitializeComponent(); this.ViewModel = new ItemListViewModels(); }