mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 10:10:48 +01:00
21 lines
467 B
C#
21 lines
467 B
C#
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;
|
|
}
|
|
}
|
|
}
|