-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
33 lines (30 loc) · 990 Bytes
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Windows;
using ArkPlotWpf.Services;
using ArkPlotWpf.View;
using ArkPlotWpf.ViewModel;
using CommunityToolkit.Mvvm.Messaging;
namespace ArkPlotWpf
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var messenger = WeakReferenceMessenger.Default;
messenger.Register<OpenWindowMessage>(this, (recipient, message) =>
{
// 根据消息中的WindowName打开相应的窗口
if (message.WindowName == "TagEditor")
{
var editorView = new TagEditor();
var editorViewModel = new TagEditorViewModel(message.JsonPath);
editorView.DataContext = editorViewModel;
editorView.Show();
}
});
}
}
}