using Avalonia.Controls;
namespace YKanBan.Views;
///
/// Shows a modal window owned by another window, applying the startup culture's
/// flow direction first. FlowDirection does not inherit across windows, so every
/// modal must apply it explicitly.
///
internal static class ModalWindow {
///
/// Shows a modal window that returns a result.
///
/// The owning window.
/// The modal window to show.
/// The dialog result type.
/// A task completing with the dialog result.
public static Task ShowAsync(Window owner, Window dialog) {
dialog.FlowDirection = App.UiFlowDirection;
return dialog.ShowDialog(owner);
}
///
/// Shows a modal window that has no result.
///
/// The owning window.
/// The modal window to show.
/// A task completing when the dialog closes.
public static Task ShowAsync(Window owner, Window dialog) {
dialog.FlowDirection = App.UiFlowDirection;
return dialog.ShowDialog(owner);
}
}