public SettingsViewModel(MegaSDK megaSdk, AppInformation appInformation) : base(megaSdk, appInformation) { this.ShareRecoveryKeyCommand = new DelegateCommand(ShareRecoveryKey); this.CopyRecoveryKeyCommand = new DelegateCommand(CopyRecoveryKey); this.ChangePinLockCommand = new DelegateCommand(ChangePinLock); this.ViewRecoveryKeyCommand = new DelegateCommand(ViewRecoveryKey); this.CloseOtherSessionsCommand = new DelegateCommand(CloseOtherSessions); this.ClearCacheCommand = new DelegateCommand(ClearCache); #if WINDOWS_PHONE_80 this.SelectDownloadLocationCommand = null; #elif WINDOWS_PHONE_81 this.SelectDownloadLocationCommand = new DelegateCommand(SelectDownloadLocation); #endif this.MegaSdkCommand = new DelegateCommand(NavigateToMegaSdk); this.GoedWareCommand = new DelegateCommand(NavigateToGoedWare); this.TermsOfServiceCommand = new DelegateCommand(NavigateToTermsOfService); this.PrivacyPolicyCommand = new DelegateCommand(NavigateToPrivacyPolicy); this.CopyrightCommand = new DelegateCommand(NavigateToCopyright); this.TakedownGuidanceCommand = new DelegateCommand(NavigateToTakedownGuidance); this.GeneralCommand = new DelegateCommand(NavigateToGeneral); this.DataProtectionRegulationCommand = new DelegateCommand(NavigateToDataProtectionRegulation); this.Initialize(); UpdateUserData(); InitializeMenu(HamburgerMenuItemType.Settings); AccountDetails.GetAppCacheSize(); }
/// Clear the app cache /// </summary> private async void ClearCache(object obj) { string title, message = string.Empty; if (await AppService.ClearAppCacheAsync()) { title = AppMessages.CacheCleared_Title; message = AppMessages.CacheCleared; } else { title = AppMessages.AM_ClearCacheFailed_Title; message = AppMessages.AM_ClearCacheFailed; } OnUiThread(() => { new CustomMessageDialog(title, message, App.AppInformation, MessageDialogButtons.Ok).ShowDialog(); }); AccountDetails.GetAppCacheSize(); }