diff --git a/UI/Services/DialogService.cs b/UI/Services/DialogService.cs index c700b52..8c823fa 100644 --- a/UI/Services/DialogService.cs +++ b/UI/Services/DialogService.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using TagHierarchyManager.Models; using TagHierarchyManager.UI.ViewModels; using TagHierarchyManager.UI.Views; @@ -15,7 +13,7 @@ public class DialogService { public async Task ShowDialog(Window dialog, object? dataContext = null) { - var ownerWindow = this.GetOwnerWindow(); + var ownerWindow = GetOwnerWindow(); dialog.DataContext = dataContext; return await dialog.ShowDialog(ownerWindow); } @@ -25,13 +23,7 @@ public class DialogService return this.ShowDialog(new ErrorDialog(), new ErrorDialogViewModel(message)); } - public Task ShowAmbiguousSaveDialog(Tag tag, List parentTags) - { - var viewModel = new SaveAmbiguousViewModel(tag, parentTags); - return this.ShowDialog(new SaveAmbiguousDialog(), viewModel); - } - - private Window GetOwnerWindow() + private static Window GetOwnerWindow() { if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) throw new InvalidOperationException("Not in a desktop environment.");