Example #1
0
 public App()
 {
     // The theme can only be changed in ctor
     AppViewModel = new AppViewModel(this)
     {
         AppSetting = AppContext.LoadSetting() ?? AppSetting.CreateDefault()
     };
     RequestedTheme = AppViewModel.AppSetting.Theme switch
     {
         ApplicationTheme.Dark => Microsoft.UI.Xaml.ApplicationTheme.Dark,
         ApplicationTheme.Light => Microsoft.UI.Xaml.ApplicationTheme.Light,
         _ => RequestedTheme
     };
     AppInstance.GetCurrent().Activated += (_, arguments) => ActivationRegistrar.Dispatch(arguments);
     InitializeComponent();
 }
Example #2
0
 public async void Receive(LoginCompletedMessage message)
 {
     DownloadManager = new DownloadManager <ObservableDownloadTask>(AppSetting.MaxDownloadTaskConcurrencyLevel, MakoClient.GetMakoHttpClient(MakoApiKind.ImageApi));
     await AppContext.RestoreHistories();
 }
Example #3
0
 public void Receive(ApplicationExitingMessage message)
 {
     AppContext.SaveContext();
 }