Пример #1
0
        private async void Data_PropertyChangedAsync(object sender, PropertyChangedEventArgs e)
        {
            using (await DataChangedHandlerAsyncLock.LockAsync())
            {
                switch (e.PropertyName)
                {
                case nameof(AppUserData.DarkMode):
                case nameof(AppUserData.SyncTheme):
                    this.SetTheme(Data.DarkMode, Data.SyncTheme);
                    break;

                case nameof(AppUserData.ShowIncompleteTranslations):
                    LocalizationManager.RefreshLanguages(Data.ShowIncompleteTranslations);
                    break;

                case nameof(AppUserData.BackupLocation):

                    await RCPServices.App.OnRefreshRequiredAsync(new RefreshRequiredEventArgs(null, false, false, true, false));

                    if (!PreviousBackupLocation.DirectoryExists)
                    {
                        RL.Logger?.LogInformationSource("The backup location has been changed, but the previous directory does not exist");
                        return;
                    }

                    RL.Logger?.LogInformationSource("The backup location has been changed and old backups are being moved...");

                    await RCPServices.App.MoveBackupsAsync(PreviousBackupLocation, Data.BackupLocation);

                    PreviousBackupLocation = Data.BackupLocation;

                    break;

                case nameof(AppUserData.LinkItemStyle):
Пример #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public SettingsPageViewModel()
        {
            ContributeLocalizationCommand = new RelayCommand(ContributeLocalization);
            EditJumpListCommand           = new AsyncRelayCommand(EditJumpListAsync);

            CanEditShowUnderInstalledPrograms = App.IsRunningAsAdmin;
            LocalizationManager.RefreshLanguages(Data.ShowIncompleteTranslations);
        }