Files @ 70b1de28b2a2
Branch filter:

Location: ATITD-Tools/Desert-Paint-Codex/Util/DialogUtil.cs - annotation

Jason Maltzen
Re-enable the ability to save debug screenshots based on a setting value to help debug reaction capturing. Update the README to correctly reflect the debug.screenshot setting name, location of the settings file, and removal of the old debug menu.
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using ReactiveUI;

namespace DesertPaintCodex.Util
{
    public static class DialogUtil
    {
        public static async Task ShowDialog<View, ViewModel, ReturnType>(
            InteractionContext<ViewModel, ReturnType> interaction) where View : Window, new()
        {
            if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                View       dialog = new() {DataContext = interaction.Input};
                ReturnType result = await dialog.ShowDialog<ReturnType>(desktop.MainWindow);
                interaction.SetOutput(result);
            }
        }
    }
}