Use dialog instead of window for oopsies

This commit is contained in:
BlossomiShymae
2024-08-18 22:10:04 -05:00
parent d26180dce5
commit f0294b3042
16 changed files with 118 additions and 199 deletions

View File

@@ -0,0 +1,20 @@
using FluentAvalonia.UI.Controls;
using System;
using System.Threading.Tasks;
namespace Needlework.Net.Services
{
public class DialogService
{
public async Task<ContentDialogResult> ShowAsync<T>(object data)
where T : IDialog, IDisposable
{
T dialog = Activator.CreateInstance<T>();
var result = await dialog.ShowAsync(data);
dialog.Dispose();
return result;
}
}
}