public ShellPage() { this.InitializeComponent(); this.DataContext = viewModel; this.Loaded += MainPage_Loaded; Current = this; viewModel.NotificationList.CollectionChanged += NotificationList_CollectionChanged; }
private async void ReportListPage_Loaded(object sender, RoutedEventArgs e) { this.DataContext = null; ShellPage.SetSpinner(LoadingState.Loading); await faultReportAccess.FillCaches(); var reports = await faultReportAccess.GetFaultReports(DeviceSettings.ObjectID); ShellPage.SetSpinner(LoadingState.Finished); Reports = reports.OrderByDescending(r => r.RegDate).ToList(); this.DataContext = this; }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); viewModel.Model = e.Parameter as FaultReport; this.DataContext = viewModel; ShellPage.SetSpinner(LoadingState.Loading); await viewModel.InitAsync(); ShellPage.SetSpinner(LoadingState.Finished); }
private async void SaveDeviceSettings(object param) { ShellPage.SetSpinner(LoadingState.Loading); var status = await DAL.ConnectToCloud(); viewModel.ConnectionStatus = !status; DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(2500); timer.Tick += Timer_Tick; if (status) { viewModel.AuthorisationMessage = "Log in Successful!"; ShellPage.Current.AddNotificatoin( NotificationType.Information, "Log In Successful!", "You have been connected to IFS Clouds Service!"); ShellPage.Current.EnableFullNavList(); } else { viewModel.AuthorisationMessage = "Authorization Failed. Please Enter Valid details or check your Internet Connection!"; ShellPage.Current.AddNotificatoin( NotificationType.Warning, "Authorization Failed!", "Please enter valid IFS Cloud Log In details or check your Internet Connection!\nCloud Services are not available."); if (viewModel.IsValidated) { ShellPage.Current.EnableFullNavList(); } } timer.Start(); ShellPage.SetSpinner(LoadingState.Finished); }