Implement PaymentInfoPopup with ViewModel and acknowledgment functionality
This commit is contained in:
parent
1c44f686ab
commit
fb0e7978ee
@ -0,0 +1,57 @@
|
||||
using CommunityToolkit.Maui.Views;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace gehGassiApp.ViewModels.Popups
|
||||
{
|
||||
/// <summary>
|
||||
/// 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);
|
||||
/// }
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prüft, ob der Zahlungshinweis bereits angezeigt wurde
|
||||
/// </summary>
|
||||
public static bool HasInfoBeenShown()
|
||||
{
|
||||
return Preferences.Get(PAYMENT_INFO_SHOWN_KEY, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Markiert den Hinweis als angezeigt
|
||||
/// </summary>
|
||||
private static void MarkInfoAsShown()
|
||||
{
|
||||
Preferences.Set(PAYMENT_INFO_SHOWN_KEY, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User hat den Hinweis zur Kenntnis genommen
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
private async Task Acknowledge()
|
||||
{
|
||||
// Hinweis als angezeigt markieren
|
||||
MarkInfoAsShown();
|
||||
|
||||
// Popup schließen
|
||||
await _popup.CloseAsync(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
98
gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml
Normal file
98
gehGassiApp/gehGassiApp/Views/Popups/PaymentInfoPopup.xaml
Normal file
@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<toolkit:Popup
|
||||
x:Class="gehGassiApp.Views.Popups.PaymentInfoPopup"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:res="clr-namespace:gehGassiApp.Resources"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
CanBeDismissedByTappingOutsideOfPopup="True"
|
||||
Color="Transparent">
|
||||
|
||||
<!-- Popup Content -->
|
||||
<Border
|
||||
Padding="0"
|
||||
BackgroundColor="White"
|
||||
StrokeShape="RoundRectangle 16"
|
||||
StrokeThickness="0"
|
||||
WidthRequest="350">
|
||||
|
||||
<!-- Drop Shadow Effect -->
|
||||
<Border.Shadow>
|
||||
<Shadow
|
||||
Brush="{AppThemeBinding Light={StaticResource Grey_Dark},
|
||||
Dark={StaticResource Grey_Dark_Dark}}"
|
||||
Opacity="0.3"
|
||||
Radius="8"
|
||||
Offset="0,4" />
|
||||
</Border.Shadow>
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||
|
||||
<!-- Header -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="20,16"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
StrokeShape="RoundRectangle 16,16,0,0"
|
||||
StrokeThickness="0">
|
||||
<Label
|
||||
Style="{StaticResource H4}"
|
||||
Text="Zahlungshinweis"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_White},
|
||||
Dark={StaticResource Primary_White_Dark}}"
|
||||
VerticalOptions="Center" />
|
||||
</Border>
|
||||
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Padding="20,20"
|
||||
Spacing="16">
|
||||
|
||||
<!-- Info Icon -->
|
||||
<Label
|
||||
FontFamily="MaterialIconsRegular"
|
||||
FontSize="48"
|
||||
HorizontalOptions="Center"
|
||||
Text="info"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
|
||||
<!-- Info Text -->
|
||||
<Label
|
||||
HorizontalTextAlignment="Center"
|
||||
LineHeight="1.4"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="Leider sind diese Funktionen im Juli nicht verfügbar. Wir arbeiten aber fleißig an einer Lösung."
|
||||
TextColor="{AppThemeBinding Light={StaticResource Grey_Dark},
|
||||
Dark={StaticResource Grey_Dark_Dark}}" />
|
||||
|
||||
<!-- Additional Info -->
|
||||
<Label
|
||||
HorizontalTextAlignment="Center"
|
||||
LineHeight="1.4"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="Im Juli sind nur Barzahlungen verfügbar."
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Action Button -->
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="20,0,20,20"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
Command="{Binding AcknowledgeCommand}"
|
||||
CornerRadius="12"
|
||||
FontAttributes="Bold"
|
||||
FontSize="{StaticResource FontLabelM}"
|
||||
Text="Verstanden"
|
||||
TextColor="White" />
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</toolkit:Popup>
|
||||
@ -0,0 +1,13 @@
|
||||
using CommunityToolkit.Maui.Views;
|
||||
using gehGassiApp.ViewModels.Popups;
|
||||
|
||||
namespace gehGassiApp.Views.Popups;
|
||||
|
||||
public partial class PaymentInfoPopup : Popup
|
||||
{
|
||||
public PaymentInfoPopup()
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = new PaymentInfoPopupViewModel(this);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user