ConventionBinder now binds IDialogViewModel.Submit to close the associated view
This commit is contained in:
parent
364b8919b5
commit
e11922ae4f
3 changed files with 73 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue