Skip to content

Commit 96828fb

Browse files
committed
Feat | 导航服务
1 parent 50bed33 commit 96828fb

11 files changed

+86
-394
lines changed

ShadowViewer/Helpers/NavigateHelper.cs

-34
This file was deleted.

ShadowViewer/MainWindow.xaml.cs

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515
using ShadowViewer.Plugin.PluginManager;
1616
using ShadowViewer.Services;
1717
using SqlSugar;
18-
using System.Globalization;
1918
using System.Threading.Tasks;
2019
using Microsoft.UI.Xaml.Controls;
2120
using ShadowViewer.Pages;
2221
using CustomExtensions.WinUI;
2322
using Microsoft.UI.Windowing;
24-
using ShadowViewer.Helpers;
2523

2624
namespace ShadowViewer;
2725

28-
public sealed partial class MainWindow : Window
26+
public sealed partial class MainWindow
2927
{
3028
private NavigationPage? navigationPage;
3129
private ShadowTitleBar? shadowTitleBar;
@@ -59,18 +57,19 @@ private async void Content_Loaded(object sender, RoutedEventArgs e)
5957
LoadingText.Text = "加载标题栏...";
6058
var caller = DiFactory.Services.Resolve<ICallableService>();
6159
navigationPage = new NavigationPage();
62-
shadowTitleBar = new ShadowTitleBar(this);
63-
MainGrid.Children.Add(shadowTitleBar);
6460
Grid.SetRow(navigationPage, 1);
6561
MainGrid.Children.Add(navigationPage);
62+
shadowTitleBar = new ShadowTitleBar(this);
63+
MainGrid.Children.Add(shadowTitleBar);
6664
shadowTitleBar.InitAppTitleBar_BackButtonClick(navigationPage.AppTitleBar_BackButtonClick);
6765
shadowTitleBar.InitAppTitleBar_OnPaneButtonClick(navigationPage.AppTitleBar_OnPaneButtonClick);
6866
caller.ThemeChangedEvent += shadowTitleBar.AppTitleBar_ThemeChangedEvent;
6967
caller.DebugEvent += shadowTitleBar.AppTitleBar_DebugEvent;
7068
// await OutAnimationLoadingGrid.StartAsync();
71-
LoadingGrid.Visibility = Visibility.Collapsed;
7269
MainGrid.Visibility = Visibility.Visible;
73-
if (firstUri != null) NavigateHelper.ShadowNavigate(firstUri);
70+
LoadingGrid.Visibility = Visibility.Collapsed;
71+
var navigateService = DiFactory.Services.Resolve<INavigateService>();
72+
if (firstUri != null) navigateService.Navigate(firstUri);
7473
}
7574

7675

@@ -89,7 +88,7 @@ private async Task OnLoading(IProgress<string>? loadingProgress)
8988

9089
var pluginServices = DiFactory.Services.Resolve<PluginLoader>();
9190

92-
var currentCulture = CultureInfo.CurrentUICulture;
91+
// var currentCulture = CultureInfo.CurrentUICulture;
9392

9493
loadingProgress?.Report("加载插件...");
9594
try

ShadowViewer/Pages/NavigationPage.xaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030

3131
<Grid
3232
x:Name="Root"
33-
AllowDrop="True"
34-
DragLeave="Root_DragLeave"
35-
DragOver="Root_DragOver"
36-
Drop="Root_Drop">
33+
AllowDrop="True">
3734
<Frame x:Name="ContentFrame" />
3835
<Grid
3936
x:Name="OverBorder"

0 commit comments

Comments
 (0)