private async Task LoadAppAsync() { // Setup listening for theme changes: ThemeUtils.SetupThemeListener(); // Setup listener for window activated changes: UiUtils.SetupWindowActivatedListener(); // Setup window: UiUtils.SetupWindow(Application.Current); // Perform app update tasks if necessary: await AppUpdateHelper.OnAppStartAsync(); // Setup App Center crashes, push: AppCenterHelper.SetupAppCenter(); await ShowReportCrashIfNeeded(); // Register background tasks: Logger.Info("Registering background tasks..."); // TODO: Add background tasks here Logger.Info("Finished registering background tasks."); // Show initial start dialog: /*if (!Settings.getSettingBoolean(SettingsConsts.HIDE_INITIAL_START_DIALOG_ALPHA)) * { * InitialStartDialog initialStartDialog = new InitialStartDialog(); * await UiUtils.ShowDialogAsync(initialStartDialog); * } * * // Show what's new dialog: * if (!Settings.getSettingBoolean(SettingsConsts.HIDE_WHATS_NEW_DIALOG)) * { * WhatsNewDialog whatsNewDialog = new WhatsNewDialog(); * await UiUtils.ShowDialogAsync(whatsNewDialog); * }*/ EvaluateActivationArgs(); }
private async Task LoadAppAsync() { // Setup listening for theme changes: ThemeUtils.SetupThemeListener(); // Setup listener for window activated changes: UiUtils.SetupWindowActivatedListener(); // Setup window: UiUtils.SetupWindow(Application.Current); // Setup App Center crashes, push: AppCenterHelper.SetupAppCenter(); await ShowReportCrashIfNeeded(); // Perform app update tasks if necessary: await AppUpdateHelper.OnAppStartAsync(); // Register background tasks: Logger.Info("Registering background tasks..."); await BackgroundTaskHelper.RegisterBackgroundTasksAsync(); Logger.Info("Finished registering background tasks."); // Initialize the chat background helper: ChatBackgroundHelper.INSTANCE.Init(); // Initialize the curated list of XMPP server providers: await XMPPProviders.INSTANCE.initAsync(); // Load all chats: await DataCache.INSTANCE.InitAsync(); // Connect to all clients: ConnectionHandler.INSTANCE.ConnectAll(); // Initialize push: PushManager.INSTANCE.Init(); // Remove toasts: ToastHelper.RemoveToastGroup(ToastHelper.WILL_BE_SEND_LATER_TOAST_GROUP); ToastHelper.RemoveChatToastGroups(); // Update badge notification count: ToastHelper.ResetBadgeCount(); // Show welcome dialog: if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.HIDE_WELCOME_DIALOG)) { InitialStartDialog initialStartDialog = new InitialStartDialog(); await UiUtils.ShowDialogAsync(initialStartDialog); } // Show what's new dialog: if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.HIDE_WHATS_NEW_DIALOG)) { WhatsNewDialog whatsNewDialog = new WhatsNewDialog(); await UiUtils.ShowDialogAsync(whatsNewDialog); if (whatsNewDialog.VIEW_MODEL.MODEL.ToDonatePageNavigated) { if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.INITIALLY_STARTED)) { PerformInitialStartSetup(); } return; } } EvaluateActivationArgs(); }
private async Task LoadAppAsync() { // Setup listening for theme changes: ThemeUtils.SetupThemeListener(); // Setup listener for window activated changes: UiUtils.SetupWindowActivatedListener(); // Setup window: UiUtils.SetupWindow(Application.Current); // Setup App Center crashes, push: AppCenterHelper.SetupAppCenter(APP_CENTER_PUSH_CALLBACK); // Perform app update tasks if necessary: await AppUpdateHelper.OnAppStartAsync(); // Register background tasks: Logger.Info("Registering background tasks..."); await BackgroundTaskHelper.RegisterBackgroundTasksAsync(); Logger.Info("Finished registering background tasks."); // Init the chat background helper: ChatBackgroundHelper.INSTANCE.Init(); // Load all chats: await DataCache.INSTANCE.InitAsync(); // Connect to all clients: ConnectionHandler.INSTANCE.ConnectAll(); // Remove the messages will be send later toast: ToastHelper.RemoveToastGroup(ToastHelper.WILL_BE_SEND_LATER_TOAST_GROUP); // Update badge notification count: ToastHelper.UpdateBadgeNumber(); // Show initial start dialog: if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.HIDE_INITIAL_START_DIALOG_ALPHA)) { InitialStartDialog initialStartDialog = new InitialStartDialog(); await UiUtils.ShowDialogAsync(initialStartDialog); } // Show what's new dialog: if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.HIDE_WHATS_NEW_DIALOG)) { WhatsNewDialog whatsNewDialog = new WhatsNewDialog(); await UiUtils.ShowDialogAsync(whatsNewDialog); if (whatsNewDialog.VIEW_MODEL.MODEL.ToDonatePageNavigated) { if (!Storage.Classes.Settings.GetSettingBoolean(SettingsConsts.INITIALLY_STARTED)) { PerformInitialStartSetup(); } return; } } EvaluateActivationArgs(); }
private async Task LoadAppAsync() { // Set requested theme: UiUtils.LoadRequestedTheme(); // Setup listening for theme changes: UiUtils.SetupThemeListener(); // Setup window: UiUtils.SetupWindow(Application.Current); // Setup App Center crashes, push: AppCenterHelper.SetupAppCenter(APP_CENTER_PUSH_CALLBACK); // Perform App update tasks if necessary: await AppUpdateHelper.OnAppStartAsync(); // Register background tasks: Logger.Info("Registering background tasks..."); await BackgroundTaskHelper.RegisterBackgroundTasksAsync(); Logger.Info("Finished registering background tasks."); // Init all db managers to force event subscriptions: await InitDBManagersAsync(); // Init the chat background helper: ChatBackgroundHelper.INSTANCE.Init(); // Setup push server connection: /*if (!Settings.getSettingBoolean(SettingsConsts.DISABLE_PUSH)) * { * Push_App_Server.Classes.PushManager.init(); * }*/ if (ACTIVATION_ARGS.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: Load state from previously suspended application } // Connect to all clients: ConnectionHandler.INSTANCE.connectAll(); // Remove the messages will be send later toast: ToastHelper.removeToastGroup(ToastHelper.WILL_BE_SEND_LATER_TOAST_GROUP); // Show initial start dialog: if (!Data_Manager2.Classes.Settings.getSettingBoolean(SettingsConsts.HIDE_INITIAL_START_DIALOG_ALPHA)) { InitialStartDialog initialStartDialog = new InitialStartDialog(); await UiUtils.ShowDialogAsync(initialStartDialog); } // Show what's new dialog: if (!Data_Manager2.Classes.Settings.getSettingBoolean(SettingsConsts.HIDE_WHATS_NEW_DIALOG)) { WhatsNewDialog whatsNewDialog = new WhatsNewDialog(); await UiUtils.ShowDialogAsync(whatsNewDialog); if (whatsNewDialog.VIEW_MODEL.MODEL.ToDonatePageNavigated) { if (!Data_Manager2.Classes.Settings.getSettingBoolean(SettingsConsts.INITIALLY_STARTED)) { PerformInitialStartSetup(); } return; } } EvaluateActivationArgs(); }