using System; using System.Collections.Generic; using System.Threading.Tasks; using MaterialDesignThemes.Wpf; using Ninject.Parameters; namespace Artemis.UI.Shared.Services { /// /// Provides different ways of showing confirmation dialogs and custom dialogs /// public interface IDialogService : IArtemisSharedUIService { /// /// Shows a confirm dialog on the main dialog host /// /// The title of the dialog /// The body text of the dialog /// The text of the confirm button, defaults to "Confirm" /// The text of the cancel button, defaults to "Cancel" /// A task that resolves to true if confirmed and false if cancelled Task ShowConfirmDialog(string header, string text, string confirmText = "Confirm", string cancelText = "Cancel"); /// /// Shows a confirm dialog on the dialog host provided in identifier. /// /// /// The identifier of the to use eg. /// <materialDesign:DialogHost Identifier="MyDialogHost"> /// /// The title of the dialog /// The body text of the dialog /// The text of the confirm button, defaults to "Confirm" /// The text of the cancel button, defaults to "Cancel" /// A task that resolves to true if confirmed and false if cancelled Task ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel"); /// /// Shows a dialog by initializing a view model implementing /// /// The type of the view model /// A task resolving to the result of the dialog's Task ShowDialog() where T : DialogViewModelBase; /// /// Shows a dialog by initializing a view model implementing with arguments passed /// to the view models constructor /// /// The type of the view model /// A dictionary of constructor arguments to pass to the view model /// A task resolving to the result of the dialog's Task ShowDialog(Dictionary parameters) where T : DialogViewModelBase; /// /// Shows a dialog by initializing a view model implementing using an array of /// Ninject , requires you to reference Ninject /// /// The type of the view model /// An array of Ninject to pass to the view model during activation /// A task resolving to the result of the dialog's Task ShowDialog(IParameter[] parameters) where T : DialogViewModelBase; /// /// Shows a dialog by initializing a view model implementing /// /// The type of the view model /// /// The identifier of the to use eg. /// <materialDesign:DialogHost Identifier="MyDialogHost"> /// /// A task resolving to the result of the dialog's Task ShowDialogAt(string identifier) where T : DialogViewModelBase; /// /// Shows a dialog by initializing a view model implementing with arguments passed /// to the view models constructor /// /// The type of the view model /// /// The identifier of the to use eg. /// <materialDesign:DialogHost Identifier="MyDialogHost"> /// /// A dictionary of constructor arguments to pass to the view model /// A task resolving to the result of the dialog's Task ShowDialogAt(string identifier, Dictionary parameters) where T : DialogViewModelBase; /// /// Shows a dialog by initializing a view model implementing using an array of /// Ninject , requires you to reference Ninject /// /// The type of the view model /// /// The identifier of the to use eg. /// <materialDesign:DialogHost Identifier="MyDialogHost"> /// /// An array of Ninject to pass to the view model during activation /// A task resolving to the result of the dialog's Task ShowDialogAt(string identifier, IParameter[] parameters) where T : DialogViewModelBase; /// /// Shows a dialog displaying the provided message and exception. Does not handle, log or throw the exception. /// /// The message to display in the dialog title /// A task resolving when the dialog is closed void ShowExceptionDialog(string message, Exception exception); } }