feat: manage multiple desktop device connections independently

This commit is contained in:
tongtong committed 2026-11-12 18:15:04 +08:00
1 parent 08d60de364
commit 05d4d5fea6
12 files changed
+504 -249

No files matched your search

+3 -3
View File
@@ -27,7 +27,7 @@ public partial class App : Application
}
var menu = new NativeMenu();
var show = new NativeMenuItem("打开设备工作台"); show.Click += (_, _) => Show(); menu.Items.Add(show);
menu.Items.Add(new NativeMenuItem("断开当前连接") { Command = vm.DisconnectCommand });
menu.Items.Add(new NativeMenuItem("断开全部设备") { Command = vm.DisconnectAllCommand });
menu.Items.Add(new NativeMenuItemSeparator());
var quit = new NativeMenuItem("退出并断开连接");
quit.Click += async (_, _) => await QuitAsync();
@@ -36,8 +36,8 @@ public partial class App : Application
var tray = new TrayIcon { ToolTipText = "ADS · Android 设备工作台", Icon = new WindowIcon(stream), Menu = menu, Command = new RelayCommand(Show) };
TrayIcon.SetIcons(this, new TrayIcons { tray });
vm.PropertyChanged += (_, change) => {
if (change.PropertyName is nameof(vm.Status) or nameof(vm.ActiveDeviceId))
tray.ToolTipText = "ADS · " + vm.Status;
if (change.PropertyName is nameof(vm.ConnectionSummary))
tray.ToolTipText = "ADS · " + vm.ConnectionSummary;
};
window.Closing += async (_, e) => {
if (quitting) return;