ConventionBinder now binds IDialogViewModel.Submit to close the associated view

This commit is contained in:
Markus Ewald 2025-07-05 20:17:19 +02:00
parent 364b8919b5
commit e11922ae4f
3 changed files with 73 additions and 5 deletions

View file

@ -20,20 +20,21 @@ limitations under the License.
using System;
using System.Threading.Tasks;
using Nuclex.Support;
using Nuclex.Avalonia.ViewModels;
namespace Nuclex.Windows.Forms.ViewModels {
namespace Nuclex.Avalonie.ViewModels {
/// <summary>Interface for dialog view models (typically modal ones)</summary>
public interface IDialogViewModel {
/// <summary>Indicates that the view should close</summary>
event EventHandler Submitted;
event EventHandler<DialogResultEventArgs> Submitted;
/// <summary>Indicates that the dialog should be closed</summary>
/// <param name="dialogResult">Result the dialog should return</param>
/// <returns>A task that finishes when the submit notification has been sent</returns>
Task SubmitAsync();
Task SubmitAsync(object? dialogResult = null);
}
} // namespace Nuclex.Windows.Forms.ViewModels
} // namespace Nuclex.Avalonie.ViewModels