/// <inheritdoc /> public Task <WavesMessageDialogResult> ShowDialogAsync( string text, string title = null, IWavesObject sender = null, WavesDialogMessageType type = WavesDialogMessageType.Information, WavesMessageDialogButtons buttons = WavesMessageDialogButtons.Ok) { return(_navigationService.NavigateAsync <WavesMessageDialogViewModel, WavesMessageDialogParameter, WavesMessageDialogResult>( new WavesMessageDialogParameter(text, title, sender?.GetType().GetFriendlyName(), null, type, buttons))); }
/// <inheritdoc /> public Task <WavesMessageDialogResult> ShowDialogAsync( string text, Exception exception, IWavesObject sender = null, WavesDialogMessageType type = WavesDialogMessageType.Error, WavesMessageDialogButtons buttons = WavesMessageDialogButtons.Ok) { return(_navigationService.NavigateAsync <WavesMessageDialogViewModel, WavesMessageDialogParameter, WavesMessageDialogResult>( new WavesMessageDialogParameter(text, "An exception occured", sender?.GetType().GetFriendlyName(), exception, type, buttons))); }
/// <summary> /// Creates new instance of <see cref="WavesMessageDialogParameter"/>. /// </summary> /// <param name="text">Message text.</param> /// <param name="title">Message title.</param> /// <param name="sender">Sender.</param> /// <param name="exception">Exception.</param> /// <param name="messageType">Message type.</param> /// <param name="buttons">Buttons.</param> public WavesMessageDialogParameter( string text, string title = null, string sender = null, Exception exception = null, WavesDialogMessageType messageType = WavesDialogMessageType.Information, WavesMessageDialogButtons buttons = WavesMessageDialogButtons.Ok) { Text = text; Title = title; Sender = sender; Exception = exception; MessageType = messageType; Buttons = buttons; }
/// <summary> /// Initializes buttons. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> private Task InitializeButtons(WavesMessageDialogButtons buttons) { _subscribedWavesResultTools = new List <WavesDialogResultTool>(); return(buttons switch { WavesMessageDialogButtons.Ok => InitializeOkButtons(), WavesMessageDialogButtons.OkCancel => InitializeOkCancelButtons(), WavesMessageDialogButtons.RetryCancel => InitializeRetryCancelButtons(), WavesMessageDialogButtons.AbortRetryIgnore => InitializeAbortRetryIgnoreButtons(), WavesMessageDialogButtons.YesNo => InitializeYesNoButtons(), WavesMessageDialogButtons.YesNoCancel => InitializeYesNoCancelIgnoreButtons(), WavesMessageDialogButtons.SaveDontSave => InitializeSaveDontSaveButtons(), WavesMessageDialogButtons.SaveDontSaveCancel => InitializeSaveDontSaveCancelButtons(), _ => throw new ArgumentOutOfRangeException(nameof(buttons), buttons, null), });