Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions OpenUtau/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,20 @@ async void OnMenuInstallSinger(object sender, RoutedEventArgs args) {

void OnMenuPackageManager(object sender, RoutedEventArgs args) {
try {
var dialog = new PackageManagerDialog() { DataContext = new PackageManagerViewModel() };
dialog.Show();
var desktop = Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime;
if (desktop == null) {
return;
}
var dialog = desktop.Windows.FirstOrDefault(w => w is PackageManagerDialog) as PackageManagerDialog;
if (dialog == null) {
dialog = new PackageManagerDialog() { DataContext = new PackageManagerViewModel() };
}
if (dialog.Position.Y < 0) dialog.Position = dialog.Position.WithY(0);
if (dialog.WindowState == WindowState.Minimized) {
dialog.WindowState = WindowState.Normal;
}
dialog.Show();
dialog.Activate();
} catch (Exception e) {
DocManager.Inst.ExecuteCmd(new ErrorMessageNotification(e));
}
Expand Down
Loading