diff --git a/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs b/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs new file mode 100644 index 0000000..1efd047 --- /dev/null +++ b/gehGassiApp/gehGassiApp/ViewModels/Popups/PaymentInfoPopupViewModel.cs @@ -0,0 +1,57 @@ +using CommunityToolkit.Maui.Views; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace gehGassiApp.ViewModels.Popups +{ + /// + /// ViewModel für das Zahlungshinweis-Popup + /// + /// Verwendung: + /// // Prüfen ob bereits angezeigt + /// if (!PaymentInfoPopupViewModel.HasInfoBeenShown()) + /// { + /// var popup = new PaymentInfoPopup(); + /// await Shell.Current.CurrentPage.ShowPopupAsync(popup); + /// } + /// + public partial class PaymentInfoPopupViewModel : ObservableObject + { + private readonly Popup _popup; + private const string PAYMENT_INFO_SHOWN_KEY = "payment_info_july_shown_2025"; + + public PaymentInfoPopupViewModel(Popup popup) + { + _popup = popup; + } + + /// + /// Prüft, ob der Zahlungshinweis bereits angezeigt wurde + /// + public static bool HasInfoBeenShown() + { + return Preferences.Get(PAYMENT_INFO_SHOWN_KEY, false); + } + + /// + /// Markiert den Hinweis als angezeigt + /// + private static void MarkInfoAsShown() + { + Preferences.Set(PAYMENT_INFO_SHOWN_KEY, true); + } + + /// + /// User hat den Hinweis zur Kenntnis genommen + /// + [RelayCommand] + private async Task Acknowledge() + { + // Hinweis als angezeigt markieren + MarkInfoAsShown(); + + // Popup schließen + await _popup.CloseAsync(true); + } + } +} diff --git a/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml b/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml new file mode 100644 index 0000000..fe318b5 --- /dev/null +++ b/gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + +