Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/Captura/Pages/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.Windows.Controls;
using Captura.Views;

namespace Captura
Expand All @@ -7,12 +8,30 @@ public partial class AboutPage
{
void ViewLicenses(object Sender, RoutedEventArgs E)
{
NavigationService?.Navigate(new LicensesPage());
// Navigate using the immediate parent Frame (AboutFrame), not the grandparent
var parentFrame = Parent as Frame;
if (parentFrame != null)
{
parentFrame.Navigate(new LicensesPage());
}
else
{
NavigationService?.Navigate(new LicensesPage());
}
}

void ViewCrashLogs(object Sender, RoutedEventArgs E)
{
NavigationService?.Navigate(new CrashLogsPage());
// Navigate using the immediate parent Frame (AboutFrame), not the grandparent
var parentFrame = Parent as Frame;
if (parentFrame != null)
{
parentFrame.Navigate(new CrashLogsPage());
}
else
{
NavigationService?.Navigate(new CrashLogsPage());
}
}
}
}
22 changes: 21 additions & 1 deletion src/Captura/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,27 @@
<Frame Source="TrimmerPage.xaml"/>
</TabItem>
<TabItem Header="{Binding About, Source={StaticResource Loc}, Mode=OneWay}">
<Frame Source="AboutPage.xaml"/>
<DockPanel>
<DockPanel DockPanel.Dock="Top"
Margin="5,5,5,10">
<mui:ModernButton IconData="{Binding Icons.Back, Source={StaticResource ServiceLocator}}"
IsEnabled="{Binding CanGoBack, ElementName=AboutFrame}"
EllipseDiameter="40"
IconWidth="35"
IconHeight="25"
Margin="5,0,2,0"
Click="AboutBackButton_Click"/>

<mui:ModernButton IconData="{Binding Icons.Forward, Source={StaticResource ServiceLocator}}"
IsEnabled="{Binding CanGoForward, ElementName=AboutFrame}"
Click="AboutForwardButton_Click"/>
</DockPanel>
<Frame x:Name="AboutFrame"
Source="AboutPage.xaml"
NavigationUIVisibility="Hidden"
JournalOwnership="OwnsJournal"
Navigated="AboutFrame_Navigated"/>
</DockPanel>
</TabItem>
</TabControl>
</Grid>
Expand Down
32 changes: 32 additions & 0 deletions src/Captura/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Windows;
using System.Windows.Navigation;

namespace Captura
Expand All @@ -25,5 +26,36 @@ public SettingsPage()
}
};
}

void AboutBackButton_Click(object sender, RoutedEventArgs e)
{
if (AboutFrame.CanGoBack)
{
AboutFrame.GoBack();
}
}

void AboutForwardButton_Click(object sender, RoutedEventArgs e)
{
if (AboutFrame.CanGoForward)
{
AboutFrame.GoForward();
}
}

void AboutFrame_Navigated(object sender, NavigationEventArgs e)
{
// Forcefully hide NavigationUI after navigation
if (sender is System.Windows.Controls.Frame frame)
{
frame.NavigationUIVisibility = NavigationUIVisibility.Hidden;

// Also ensure the page itself doesn't have NavigationService chrome
if (e.Content is System.Windows.Controls.Page page)
{
page.ShowsNavigationUI = false;
}
}
}
}
}
Loading