Click or drag to resize

IDialogViewModel Interface

The DataContext and binding source for the dialog Window. Implement this interface or the derived abstract DialogViewModel to transport data from the view to the view model via binding. The IDialogViewModel will be the content of the dialog window. This means the corresponding DataTemplate can define e.g. an input form that can bind to the IDialogViewModel. Register a callback with the ResponseCallbackAsync property to process the DialogResult and the data of the IDialogViewModel.

Namespace:  BionicCode.Utilities.Net.Framework.Wpf.Dialog
Assembly:  BionicCode.Utilities.Net.Framework.Wpf (in BionicCode.Utilities.Net.Framework.Wpf.dll) Version: 1.0.3.0 (1.0.0.0)
Syntax
public interface IDialogViewModel : IViewModel, 
	INotifyPropertyChanged, INotifyDataErrorInfo

The IDialogViewModel type exposes the following members.

Properties
  NameDescription
Public propertyDialogResult
The DialogResult of the user interaction.
Public propertyHasErrors
Gets a value that indicates whether the entity has validation errors.
(Inherited from INotifyDataErrorInfo.)
Public propertyMessage
The message for the dialog to show to the user.
Public propertyResponseCallbackAsync
The asynchronous callback that is invoked during the dialog interaction. Use this callback as continuation of the interrupted flow, after the required data was collected by the dialog.
Public propertySendResponseAsyncCommand
ICommand that can be bound to the buttons of the dialog. The command parameter is a DialogResult.
Public propertyTitle
The title of the dialog Window
Public propertyTitleBarIcon
The icon to display in the title bar of the Window
Top
Methods
  NameDescription
Public methodGetErrors
Gets the validation errors for a specified property or for the entire entity.
(Inherited from INotifyDataErrorInfo.)
Public methodGetPropertyErrors
Gets all error messages of the specified property. If the propertyName is null all error messages will be returned.
(Inherited from IViewModel.)
Public methodPropertyHasError
Checks whether the specified property has errors or is valid.
(Inherited from IViewModel.)
Top
Events
  NameDescription
Public eventErrorsChanged
Occurs when the validation errors have changed for a property or for the entire entity.
(Inherited from INotifyDataErrorInfo.)
Public eventInteractionCompleted
Event to signal that the interaction with the dialog is completed.
Public eventPropertyChanged
Occurs when a property value changes.
(Inherited from INotifyPropertyChanged.)
Public eventPropertyValueChanged
PropertyChanged implementation that sends old value and new value of the change and raises the INotifyPropertyChanged event.
(Inherited from IViewModel.)
Top
Remarks
It is recommended to extend the abstract class DialogViewModel instead as this class already implemented the dialog data handling logic. Also use the Dialog attached behavior as it handles the view logic. Just bind DialogDataContextProperty to an instance of DialogViewModel (or IDialogViewModel) and define a DataTemplate for each implementation of DialogViewModel.
See Also
https://github.com/BionicCode/BionicCode.Net/blob/master/README.md