Skip to content

Commit a2fddcb

Browse files
committed
Fix | AppLoaded
1 parent 043adaa commit a2fddcb

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

ShadowViewer/MainWindow.xaml.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ private async void Content_Loaded(object sender, RoutedEventArgs e)
7272
LoadingGrid.Visibility = Visibility.Collapsed;
7373
var navigateService = DiFactory.Services.Resolve<INavigateService>();
7474
if (firstUri != null) navigateService.Navigate(firstUri);
75+
caller.AppLoaded();
7576
}
7677

7778
/// <summary>
@@ -99,9 +100,11 @@ private async Task OnLoading()
99100
// var currentCulture = CultureInfo.CurrentUICulture;
100101
try
101102
{
102-
pluginServices.Scan<LocalPlugin>();
103-
pluginServices.Scan<PluginManagerPlugin>();
104-
await pluginServices.Load();
103+
await pluginServices.CheckUpgradeAndRemoveAsync();
104+
await pluginServices
105+
.Scan<LocalPlugin>()
106+
.Scan<PluginManagerPlugin>()
107+
.Load();
105108
if (PluginManagerPlugin.Settings.PluginSecurityStatement)
106109
{
107110
pluginServices.Scan(new DirectoryInfo(CoreSettings.Instance.PluginsPath));

ShadowViewer/Services/CallableService.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ namespace ShadowViewer.Services;
1414
/// </summary>
1515
internal partial class CallableService(ILogger logger) : ICallableService
1616
{
17+
/// <summary>
18+
/// Logger
19+
/// </summary>
1720
private ILogger Logger { get; } = logger;
1821

1922
/// <summary>
@@ -24,6 +27,9 @@ internal partial class CallableService(ILogger logger) : ICallableService
2427
/// <inheritdoc />
2528
public event EventHandler<TopLevelControlEventArgs>? TopLevelControlEvent;
2629

30+
/// <inheritdoc />
31+
public event EventHandler? AppLoadedEvent;
32+
2733
/// <inheritdoc />
2834
public event EventHandler? ThemeChangedEvent;
2935

@@ -51,6 +57,15 @@ public void ThemeChanged()
5157
Logger.Debug("触发事件{EventName}", nameof(ThemeChangedEvent));
5258
}
5359

60+
/// <summary>
61+
/// <inheritdoc/>
62+
/// </summary>
63+
public void AppLoaded()
64+
{
65+
AppLoadedEvent?.Invoke(this, EventArgs.Empty);
66+
Logger.Debug("触发事件{EventName}", nameof(AppLoadedEvent));
67+
}
68+
5469
/// <summary>
5570
/// <inheritdoc/>
5671
/// </summary>

0 commit comments

Comments
 (0)