Go back to welcome page when the last account is removed.

This commit is contained in:
Burak Kaan Köse
2026-03-09 14:18:13 +01:00
parent 859a5bb117
commit 9b567c4bac
9 changed files with 39 additions and 233 deletions
@@ -1,9 +0,0 @@
using Wino.Mail.WinUI;
using Wino.Mail.ViewModels;
namespace Wino.Views.Abstract;
public abstract class WelcomePageAbstract : BasePage<WelcomePageViewModel>
{
}
+13 -4
View File
@@ -29,10 +29,7 @@ public sealed partial class WelcomeHostPage : WelcomeHostPageAbstract,
WeakReferenceMessenger.Default.Register<BreadcrumbNavigationRequested>(this);
WeakReferenceMessenger.Default.Register<BackBreadcrumNavigationRequested>(this);
// Navigate to the welcome/get-started page without adding it to the wizard breadcrumb.
// Breadcrumb steps only start after the user clicks "Get Started".
var welcomePageType = ViewModel.NavigationService.GetPageType(WinoPage.WelcomePageV2);
WizardFrame.Navigate(welcomePageType, null, new SuppressNavigationTransitionInfo());
ResetWizard();
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
@@ -53,6 +50,18 @@ public sealed partial class WelcomeHostPage : WelcomeHostPageAbstract,
GoBackFrame();
}
public void ResetWizard()
{
PageHistory.Clear();
WizardFrame.BackStack.Clear();
WizardFrame.ForwardStack.Clear();
// Navigate to the welcome/get-started page without adding it to the wizard breadcrumb.
// Breadcrumb steps only start after the user clicks "Get Started".
var welcomePageType = ViewModel.NavigationService.GetPageType(WinoPage.WelcomePageV2);
WizardFrame.Navigate(welcomePageType, null, new SuppressNavigationTransitionInfo());
}
private void GoBackFrame()
{
BreadcrumbNavigationHelper.GoBack(WizardFrame, PageHistory, NavigationTransitionEffect.FromLeft);
-114
View File
@@ -1,114 +0,0 @@
<abstract:WelcomePageAbstract
x:Class="Wino.Views.WelcomePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:abstract="using:Wino.Views.Abstract"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:domain="using:Wino.Core.Domain"
xmlns:localControls="using:Wino.Mail.WinUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Style="{StaticResource PageStyle}"
mc:Ignorable="d">
<Grid Padding="32,24" RowSpacing="16">
<Grid.RowDefinitions>
<!-- Header -->
<RowDefinition Height="Auto" />
<!-- CTA Button -->
<RowDefinition Height="Auto" />
<!-- Segmented Tabs + FlipView content -->
<RowDefinition Height="*" />
<!-- Footer -->
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Header -->
<StackPanel Grid.Row="0" Spacing="4">
<TextBlock
FontSize="28"
FontWeight="SemiBold"
Text="{x:Bind domain:Translator.WelcomeWindow_Title}" />
<TextBlock
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource BodyTextBlockStyle}"
Text="{x:Bind domain:Translator.WelcomeWindow_Subtitle}"
TextWrapping="Wrap" />
</StackPanel>
<!-- Get Started CTA -->
<Button
Grid.Row="1"
Padding="24,12"
HorizontalAlignment="Stretch"
Command="{x:Bind ViewModel.NavigateManageAccountsCommand}"
Style="{StaticResource AccentButtonStyle}">
<StackPanel Spacing="4">
<TextBlock
FontSize="14"
FontWeight="SemiBold"
HorizontalTextAlignment="Center"
Text="{x:Bind domain:Translator.WelcomeWindow_GetStartedButton}" />
<TextBlock
FontSize="12"
Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}"
Opacity="0.8"
Text="{x:Bind domain:Translator.WelcomeWindow_GetStartedDescription}" />
</StackPanel>
</Button>
<!-- Tabs + Content -->
<Grid Grid.Row="2" RowSpacing="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Segmented Control -->
<controls:Segmented
x:Name="TabSegmented"
HorizontalAlignment="Center"
SelectionChanged="OnTabSelectionChanged">
<controls:SegmentedItem Content="{x:Bind domain:Translator.WelcomeWindow_FeaturesTab}" />
<controls:SegmentedItem Content="{x:Bind domain:Translator.WelcomeWindow_WhatsNewTab}" />
</controls:Segmented>
<!-- Features FlipView -->
<localControls:UpdateNotesFlipViewControl
x:Name="FeaturesFlipView"
Grid.Row="1"
Sections="{x:Bind ViewModel.FeatureSections, Mode=OneWay}"
Visibility="Visible" />
<!-- What's New FlipView -->
<localControls:UpdateNotesFlipViewControl
x:Name="WhatsNewFlipView"
Grid.Row="1"
Sections="{x:Bind ViewModel.UpdateSections, Mode=OneWay}"
Visibility="Collapsed" />
</Grid>
<!-- Footer -->
<Grid Grid.Row="3" Padding="0,8,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
VerticalAlignment="Center"
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind ViewModel.VersionDisplay, Mode=OneWay}" />
<StackPanel
Grid.Column="1"
Orientation="Horizontal"
Spacing="8">
<HyperlinkButton Content="{x:Bind domain:Translator.SettingsAboutGithub_Title}" NavigateUri="{x:Bind ViewModel.GitHubUrl, Mode=OneWay}" />
<HyperlinkButton Content="{x:Bind domain:Translator.SettingsPaypal_Title}" NavigateUri="{x:Bind ViewModel.PaypalUrl, Mode=OneWay}" />
</StackPanel>
</Grid>
</Grid>
</abstract:WelcomePageAbstract>
-25
View File
@@ -1,25 +0,0 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using CommunityToolkit.WinUI.Controls;
using Wino.Views.Abstract;
namespace Wino.Views;
public sealed partial class WelcomePage : WelcomePageAbstract
{
public WelcomePage()
{
InitializeComponent();
}
private void OnTabSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is not Segmented segmented)
return;
bool isFeaturesTab = segmented.SelectedIndex == 0;
FeaturesFlipView.Visibility = isFeaturesTab ? Visibility.Visible : Visibility.Collapsed;
WhatsNewFlipView.Visibility = isFeaturesTab ? Visibility.Collapsed : Visibility.Visible;
}
}