修改了Dialog的调用方式,和实现了添加设备添加到侧边菜单中

This commit is contained in:
2025-06-26 19:36:27 +08:00
parent 0391e76931
commit 244b67391d
11 changed files with 134 additions and 54 deletions

View File

@@ -35,8 +35,7 @@ public partial class App : Application
container.AddSingleton<NavgatorServices>();
container.AddSingleton<DevicesRepositories>();
container.AddSingleton<DialogService>();
container.AddSingleton<IDialogService,DialogService>();
container.AddSingleton<GrowlNotificationService>();
container.AddSingleton<MainViewModel>();
container.AddSingleton<HomeViewModel>();
@@ -53,7 +52,6 @@ public partial class App : Application
Services = container.BuildServiceProvider();
// 启动服务
Services.GetRequiredService<GrowlNotificationService>();
Services.GetRequiredService<DialogService>();
}
public new static App Current => (App)Application.Current;
@@ -74,11 +72,11 @@ public partial class App : Application
using (var db = DbContext.GetInstance())
{
List<DbMenu> items = new List<DbMenu>();
items.Add(new DbMenu() { Id = 1, Name = "主页", Icon = SegoeFluentIcons.Home.Glyph, ParentId = 0});
items.Add(new DbMenu() { Id = 1, Name = "设备", Icon = SegoeFluentIcons.Devices.Glyph, ParentId = 0});
items.Add(new DbMenu() { Id = 1, Name = "数据转换", Icon = SegoeFluentIcons.Move.Glyph, ParentId = 0});
items.Add(new DbMenu() { Id = 1, Name = "设置", Icon = SegoeFluentIcons.Settings.Glyph, ParentId = 0});
items.Add(new DbMenu() { Id = 1, Name = "关于", Icon = SegoeFluentIcons.Info.Glyph, ParentId = 0});
items.Add(new DbMenu() { Name = "主页", Icon = SegoeFluentIcons.Home.Glyph, ParentId = 0});
items.Add(new DbMenu() { Name = "设备", Icon = SegoeFluentIcons.Devices.Glyph, ParentId = 0});
items.Add(new DbMenu() { Name = "数据转换", Icon = SegoeFluentIcons.Move.Glyph, ParentId = 0});
items.Add(new DbMenu() { Name = "设置", Icon = SegoeFluentIcons.Settings.Glyph, ParentId = 0});
items.Add(new DbMenu() { Name = "关于", Icon = SegoeFluentIcons.Info.Glyph, ParentId = 0});
db.Insertable<DbMenu>(items).ExecuteCommand();
}