private async void RemoveAdsButton_Click(object sender, RoutedEventArgs e) { if (_storeController.FloraSenseAdFreePurchased) { return; } RemoveAds.IsEnabled = false; var result = await _storeController.StoreContext.RequestPurchaseAsync(StoreController.FloraSenseAdFree); var extendedError = string.Empty; var message = string.Empty; if (result.ExtendedError != null) { extendedError = result.ExtendedError.Message; } _debugLog?.Invoke($"[Purchase] {message} {extendedError}"); await _storeController.UpdatePurchasesInfo(); var ads = !_storeController.FloraSenseAdFreePurchased; RemoveAds.IsEnabled = ads; InApps.Show(ads); if (_storeController.FloraSenseAdFreePurchased) { OnRemoveAds?.Invoke(); } OnRemoveAds = null; }
public SettingsDialog(SettingsModel model, StoreController storeController, Action <string> debugLog = null) { InitializeComponent(); _model = model; _storeController = storeController; Backup = new SettingsModel(); Backup.Update(_model); LangBox.SelectedItem = LangBox.Items.FirstOrDefault(i => ((ComboBoxItem)i).Tag.ToString() == Backup.Language); InApps.Show(!_storeController.FloraSenseAdFreePurchased); _debugLog = debugLog; }