private async void Button_Tapped(object sender, TappedRoutedEventArgs e) { SettingDialog setting = new SettingDialog(); var result = await setting.ShowAsync(); if (result == ContentDialogResult.Primary) { DateTime.TryParse(ApplicationData.Current.LocalSettings.Values["Birth"].ToString(), out birth); } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (ApplicationData.Current.LocalSettings.Values["Birth"]==null) { SettingDialog setting = new SettingDialog(); await setting.ShowAsync(); } DateTime.TryParse(ApplicationData.Current.LocalSettings.Values["Birth"].ToString(), out birth); var timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 0, 1); timer.Tick += Timer_Tick; timer.Start(); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (ApplicationData.Current.LocalSettings.Values["Birth"] == null) { SettingDialog setting = new SettingDialog(); await setting.ShowAsync(); } DateTime.TryParse(ApplicationData.Current.LocalSettings.Values["Birth"].ToString(), out birth); var timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 0, 1); timer.Tick += Timer_Tick; timer.Start(); }