Skip to content

Commit 41e022b

Browse files
committed
Fix navigation to use AboutFrame instead of parent Frame
The issue was that AboutPage was using NavigationService which navigated in the parent TabControl Frame, not the AboutFrame we created. This caused: - The default navigation UI to appear in the wrong place - Our custom navigation buttons to remain disabled Now AboutPage correctly navigates within its immediate parent Frame (AboutFrame), ensuring the custom back/forward arrows work properly.
1 parent 6e3743a commit 41e022b

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Windows;
2+
using System.Windows.Controls;
23
using Captura.Views;
34

45
namespace Captura
@@ -7,12 +8,30 @@ public partial class AboutPage
78
{
89
void ViewLicenses(object Sender, RoutedEventArgs E)
910
{
10-
NavigationService?.Navigate(new LicensesPage());
11+
// Navigate using the immediate parent Frame (AboutFrame), not the grandparent
12+
var parentFrame = Parent as Frame;
13+
if (parentFrame != null)
14+
{
15+
parentFrame.Navigate(new LicensesPage());
16+
}
17+
else
18+
{
19+
NavigationService?.Navigate(new LicensesPage());
20+
}
1121
}
1222

1323
void ViewCrashLogs(object Sender, RoutedEventArgs E)
1424
{
15-
NavigationService?.Navigate(new CrashLogsPage());
25+
// Navigate using the immediate parent Frame (AboutFrame), not the grandparent
26+
var parentFrame = Parent as Frame;
27+
if (parentFrame != null)
28+
{
29+
parentFrame.Navigate(new CrashLogsPage());
30+
}
31+
else
32+
{
33+
NavigationService?.Navigate(new CrashLogsPage());
34+
}
1635
}
1736
}
1837
}

0 commit comments

Comments
 (0)