Search Results for

    Show / Hide Table of Contents

    Class DialogViewModel

    Implementation of IDialogViewModel. This abstract class implements the dialog data handling logic and is therefore preferred over a custom implementation of IDialogViewModel.

    Inheritance
    Object
    ViewModelCommon
    ViewModel
    DialogViewModel
    Implements
    IDialogViewModel
    IViewModel
    IProgressReporter
    IViewModelCommon
    INotifyDataErrorInfo
    IProgressReporterCommon
    INotifyPropertyChanged
    Inherited Members
    ViewModel.CreateProgressReporterFromUiThread()
    ViewModelCommon.TrySetValue<TValue>(TValue, TValue, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, TValue, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, TValue, IEqualityComparer<TValue>, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValue<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, TValue, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, TValue, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, TValue, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, Func<TValue, (T1, T2)<Boolean, IEnumerable<Object>>>, TValue, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilent<TValue>(TValue, PropertyValidationDelegate<TValue>, TValue, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, Func<TValue, Task<(T1, T2)<Boolean, IEnumerable<Object>>>>, SetBackingFieldDelegate<TValue>, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, ViewModelCommon.SetValueOptions, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, IEqualityComparer<TValue>, String)
    ViewModelCommon.TrySetValueSilentAsync<TValue>(TValue, TValue, PropertyValidationDelegateAsync<TValue>, SetBackingFieldDelegate<TValue>, String)
    ViewModelCommon.IsValueValid<TValue>(TValue, PropertyValidationDelegate<TValue>, String)
    ViewModelCommon.IsValueValidAsync<TValue>(TValue, PropertyValidationDelegateAsync<TValue>, String)
    ViewModelCommon.IsPropertyAttributeValid<TValue>(TValue, String)
    ViewModelCommon.ClearErrors(String)
    ViewModelCommon.PropertyHasError(String)
    ViewModelCommon.GetPropertyErrors(String)
    ViewModelCommon.PropertyChanged
    ViewModelCommon.OnPropertyChanged(String)
    ViewModelCommon.OnPropertyChanged(Object, Object, String)
    ViewModelCommon.GetErrors(String)
    ViewModelCommon.HasErrors
    ViewModelCommon.ErrorsChanged
    ViewModelCommon.OnProgress(ProgressData)
    ViewModelCommon.EnableIndterminateMode
    ViewModelCommon.DisableIndterminateMode
    ViewModelCommon.CreateProgressReporterFromCurrentThread()
    ViewModelCommon.OnProgressChanged(Double, Double)
    ViewModelCommon.OnProgressChanged(Double, Double, String)
    ViewModelCommon.IsReportingProgress
    ViewModelCommon.IsIndeterminate
    ViewModelCommon.ProgressText
    ViewModelCommon.ProgressValue
    ViewModelCommon.ProgressChanged
    ViewModelCommon.PropertyValueChanged
    ViewModelCommon.OnErrorsChanged(String)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.Wpf.dll
    Syntax
    public abstract class DialogViewModel : ViewModel, IDialogViewModel, IViewModel, IProgressReporter, IViewModelCommon, INotifyDataErrorInfo, IProgressReporterCommon, INotifyPropertyChanged
    Remarks

    It is recommended to 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.

    Constructors

    | Improve this Doc View Source

    DialogViewModel(String, String)

    Creates a nw instance of the DialogViewModel using a do-nothing dialog closed callback.

    Declaration
    protected DialogViewModel(string message, string title)
    Parameters
    Type Name Description
    String message

    The dialog message to sow.

    String title

    The dialog caption to appear in the title bar of the Window.

    | Improve this Doc View Source

    DialogViewModel(String, String, Func<IDialogViewModel, Task>)

    Creates a nw instance of the DialogViewModel registering a dialog closed callback.

    Declaration
    protected DialogViewModel(string message, string title, Func<IDialogViewModel, Task> sendResponseCallbackAsync)
    Parameters
    Type Name Description
    String message

    The dialog message to sow.

    String title

    The dialog caption to appear in the title bar of the Window.

    Func<IDialogViewModel, Task> sendResponseCallbackAsync

    The call back to invoke when the dialog was closed

    | Improve this Doc View Source

    DialogViewModel(String, String, ImageSource, Func<IDialogViewModel, Task>)

    Creates a nw instance of the DialogViewModel registering a dialog closed callback.

    Declaration
    protected DialogViewModel(string message, string title, ImageSource titleBarIcon, Func<IDialogViewModel, Task> sendResponseCallbackAsync)
    Parameters
    Type Name Description
    String message

    The dialog message to sow.

    String title

    The dialog caption to appear in the title bar of the Window.

    ImageSource titleBarIcon

    The ImageSource for the window's title icon.

    Func<IDialogViewModel, Task> sendResponseCallbackAsync

    The call back to invoke when the dialog was closed

    Properties

    | Improve this Doc View Source

    DialogResult

    The DialogResult of the user interaction.

    Declaration
    public DialogResult DialogResult { get; set; }
    Property Value
    Type Description
    DialogResult
    | Improve this Doc View Source

    Message

    The message for the dialog to show to the user.

    Declaration
    public string Message { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    ResponseCallbackAsync

    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.

    Declaration
    public Func<IDialogViewModel, Task> ResponseCallbackAsync { get; set; }
    Property Value
    Type Description
    Func<IDialogViewModel, Task>
    Remarks

    When using the abstract class DialogViewModel this delegate is invoked when invoking the SendResponseAsyncCommand. The parameter of this callback is the original IDialogViewModel. The callback can access the DialogResult property to get the interaction result. The ResponseCallbackAsync makes the dialog interaction fire-and-forget as the IDialogViewModelProviderSource doesn't need to wait for the dialog to close and doesn't have to store a reference to the IDialogViewModel.

    | Improve this Doc View Source

    SendResponseAsyncCommand

    ICommand that can be bound to the buttons of the dialog. The command parameter is a DialogResult.

    Declaration
    public IAsyncRelayCommand<DialogResult> SendResponseAsyncCommand { get; }
    Property Value
    Type Description
    IAsyncRelayCommand<DialogResult>
    Remarks

    When using the abstract class DialogViewModel the SendResponseAsyncCommand sets the DialogResult property and invokes the ResponseCallbackAsync continuation callback. The parameter of this callback is the original IDialogViewModel. The callback can access the DialogResult property to get the interaction result. The ResponseCallbackAsync makes the dialog interaction fire-and-forget as the IDialogViewModelProviderSource doesn't need to wait for the dialog to close and doesn't have to store a reference to the IDialogViewModel.

    | Improve this Doc View Source

    Title

    The title of the dialog Window

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    TitleBarIcon

    The icon to display in the title bar of the Window

    Declaration
    public ImageSource TitleBarIcon { get; set; }
    Property Value
    Type Description
    ImageSource

    Methods

    | Improve this Doc View Source

    CanExecuteSendResponseCommand(DialogResult)

    Declaration
    protected virtual bool CanExecuteSendResponseCommand(DialogResult commandParameter)
    Parameters
    Type Name Description
    DialogResult commandParameter
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    ExecuteSendResponseCommandAsync(DialogResult)

    Asynchronously called when the SendResponseAsyncCommand is executed.

    Declaration
    protected virtual async Task ExecuteSendResponseCommandAsync(DialogResult result)
    Parameters
    Type Name Description
    DialogResult result

    A DialogResult value that was received by the ICommand.

    Returns
    Type Description
    Task

    A Task instance to make this method awaitable.

    | Improve this Doc View Source

    OnInteractionCompleted()

    Event invocator of the InteractionCompleted event. Raising this event will request the dialog to be closed.

    Declaration
    protected virtual void OnInteractionCompleted()
    | Improve this Doc View Source

    OnInteractionCompleting(CancelEventArgs)

    Event invocator of the InteractionCompleting event. Raised before InteractionCompleted event. When overriding the member, setting the property Cancel of the cancelEventArgs parameter to true will cancel the dialog close process.

    Declaration
    protected virtual void OnInteractionCompleting(CancelEventArgs cancelEventArgs)
    Parameters
    Type Name Description
    CancelEventArgs cancelEventArgs

    When setting the property Cancel of the event's CancelEventArgs to true will cancel the dialog close process.

    Remarks

    When the dialog close process was cancelled e.g., by overriding the OnInteractionCompleting(CancelEventArgs) method and by setting the cancelEventArgs to true, a new close process can be triggered either by invoking the OnInteractionCompleted() method or by invoking the SendResponseAsyncCommand.

    Events

    | Improve this Doc View Source

    InteractionCompleted

    Event to signal that the interaction with the dialog is completed.

    Declaration
    public event EventHandler InteractionCompleted
    Event Type
    Type Description
    EventHandler
    Remarks

    When extending the abstract class DialogViewModel (instead of the IDialogViewModel interface) together with the attached property DialogDataContextProperty raising this event will notify the Dialog attached behavior class to close the Window.

    | Improve this Doc View Source

    InteractionCompleting

    Event is raised before InteractionCompleted event. Setting the property Cancel of the CancelEventArgs event argument to true will cancel the dialog close process.

    Declaration
    public event EventHandler<CancelEventArgs> InteractionCompleting
    Event Type
    Type Description
    EventHandler<CancelEventArgs>

    Implements

    IDialogViewModel
    IViewModel
    IProgressReporter
    IViewModelCommon
    INotifyDataErrorInfo
    IProgressReporterCommon
    INotifyPropertyChanged

    Extension Methods

    HelperExtensionsCommon.ToDictionary(Object)
    HelperExtensionsCommon.ToFlatDictionary(Object)

    See Also

    See advanced example
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX