/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var group = await SampleDataSource.GetGroupAsync((String)e.NavigationParameter); this.DefaultViewModel["Group"] = group; this.DefaultViewModel["Items"] = group.Items; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { List<GioiThieu> lh = new List<GioiThieu>(); lh.Add(new GioiThieu("/Assets/Item-53e88f6f-42e4-4d2c-ab41-a8d568894434.png", "SHTP-TRAINING", "")); lh.Add(new GioiThieu("/Assets/location.png", "Địa chỉ: Lô E1 – Khu Công nghệ cao, Xa lộ Hà Nội, Phường Hiệp Phú, Quận 9, TP.HCM", "bingmaps:?cp=10.855064~106.785569&lvl=17")); lh.Add(new GioiThieu("/Assets/phoneicon.png", "Điện thoại: (84-8) 39.322.230 (17) ", "tel:(84-8) 39.322.230 (17)")); lh.Add(new GioiThieu("/Assets/Reminder-Window.png", "Giúp người dùng lưu trữ các ghi chú và nhắc lịch.", "")); lh.Add(new GioiThieu("/Assets/Download.png", "Phiên bản: 1.0.0", "")); AboutUs.ItemsSource = lh; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; if (!localSettings.Values.ContainsKey("username")) { try { userfb = await ParseFacebookUtils.LogInAsync(browser, new[] { "user_about_me", "email" }); browser.Visibility = Visibility.Collapsed; var usersPosts = await ParseObject.GetQuery("GhiChu").WhereEqualTo("user", userfb).FindAsync(); if (usersPosts.Count() > 0) { ccc.Text = "Tài khoản facebook của bạn có " + usersPosts.Count().ToString() + " ghi chú."; } else { ccc.Text = "Tài khoản facebook của bạn chưa có dữ liệu."; btnDown.Visibility = Visibility.Collapsed; } var fb = new FacebookClient(); fb.AccessToken = ParseFacebookUtils.AccessToken; dynamic me = await fb.GetTaskAsync("me"); ProfilePic.Source = new BitmapImage(new Uri("https://graph.facebook.com/" + me["id"] + "/picture")); FBName.Text = me["name"]; localSettings.Values["name"] = me["name"]; localSettings.Values["username"] = userfb.Username; localSettings.Values["image"] = "https://graph.facebook.com/" + me["id"] + "/picture"; Content.Visibility = Visibility.Visible; ProgressRingGrid.Visibility = Visibility.Collapsed; } catch { } } else { var user = await ParseUser.Query.WhereEqualTo("username", localSettings.Values["username"].ToString()).FindAsync(); userfb = user.First(); var usersPosts = await ParseObject.GetQuery("GhiChu").WhereEqualTo("user", userfb).FindAsync(); if (usersPosts.Count() > 0) { ccc.Text = "Tài khoản facebook của bạn có " + usersPosts.Count().ToString() + " ghi chú."; } else { ccc.Text = "Tài khoản facebook của bạn chưa có dữ liệu."; btnDown.Visibility = Visibility.Collapsed; } FBName.Text = localSettings.Values["name"].ToString(); ProfilePic.Source = new BitmapImage(new Uri(localSettings.Values["image"].ToString())); Content.Visibility = Visibility.Visible; ProgressRingGrid.Visibility = Visibility.Collapsed; } }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { int id = Convert.ToInt16(e.NavigationParameter); DatabaseHelper help = new DatabaseHelper(); var ghichu = help.ReadContact(id); cbComplete.IsChecked = ghichu.Complete; if (ghichu.Complete) cbNhacNho.IsEnabled = false; else cbNhacNho.IsChecked = ghichu.Remind; this.DataContext = ghichu; time.Time = DateTime.ParseExact(ghichu.Time, "M/d/yyyy h:m:s tt", CultureInfo.InvariantCulture, DateTimeStyles.None).TimeOfDay; date.Date = DateTime.ParseExact(ghichu.Time, "M/d/yyyy h:m:s tt", CultureInfo.InvariantCulture, DateTimeStyles.None); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { }