/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="showCheckBox">Whether or not we should display a checkbox</param> /// <param name="checkBoxLabel">The label of the checkbox</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>int focusedButtonIndex, public ModalViewModel(string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex) { FocusedButtonIndex = focusedButtonIndex; ModalResult = App.ModalResult.Cancel; Buttons = new List <ModalButton>(); CheckBoxLabel = checkBoxLabel; ShowCheckBox = showCheckBox; Description = description; Icon = messageBoxIcon; Title = title; }
/// <summary> /// Get system icon for MessageBoxIcon. /// </summary> /// <param name="icon">The MessageBoxIcon value.</param> /// <returns>SystemIcon type Icon.</returns> public static Icon GetMessageBoxIcon( CustomMsgBoxIcon icon ) { switch( icon ) { case CustomMsgBoxIcon.Information: return SystemIcons.Information; case CustomMsgBoxIcon.Warning: return SystemIcons.Warning; case CustomMsgBoxIcon.Error: return SystemIcons.Error; case CustomMsgBoxIcon.Question: return SystemIcons.Question; default: return null; } }
/// <summary> /// Get system icon for MessageBoxIcon. /// </summary> /// <param name="icon">The MessageBoxIcon value.</param> /// <returns>SystemIcon type Icon.</returns> public static Icon GetMessageBoxIcon(CustomMsgBoxIcon icon) { switch (icon) { case CustomMsgBoxIcon.Information: return(SystemIcons.Information); case CustomMsgBoxIcon.Warning: return(SystemIcons.Warning); case CustomMsgBoxIcon.Error: return(SystemIcons.Error); case CustomMsgBoxIcon.Question: return(SystemIcons.Question); default: return(null); } }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> public ModalViewModel(string title, string description, CustomMsgBoxIcon messageBoxIcon) : this(title, description, false, "", messageBoxIcon, 0) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> /// /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param> public ModalViewModel(string title, string description, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex) : this(title, description, false, "", messageBoxIcon, focusedButtonIndex) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="showCheckBox">Whether or not we should display a checkbox</param> /// <param name="checkBoxLabel">The label of the checkbox</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> public ModalViewModel(string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon) : this(title, description, showCheckBox, checkBoxLabel, messageBoxIcon, 0) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> public ModalViewModel( string title, string description, CustomMsgBoxIcon messageBoxIcon ) : this( title, description, false, "", messageBoxIcon, 0 ) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> /// /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param> public ModalViewModel( string title, string description, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex ) : this( title, description, false, "", messageBoxIcon, focusedButtonIndex ) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="showCheckBox">Whether or not we should display a checkbox</param> /// <param name="checkBoxLabel">The label of the checkbox</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> public ModalViewModel( string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon ) : this( title, description, showCheckBox, checkBoxLabel, messageBoxIcon, 0 ) { }
/// <summary> /// Constructor of the ViewModel used by the WPF <see cref="CustomMsgBox"/>. /// </summary> /// <param name="title">Title of the modal</param> /// <param name="description">Description of the modal</param> /// <param name="showCheckBox">Whether or not we should display a checkbox</param> /// <param name="checkBoxLabel">The label of the checkbox</param> /// <param name="messageBoxIcon">the icon of the message box, from the <see cref="CustomMsgBoxIcon"/> enum</param> /// <param name="focusedButtonIndex">Index of the button that will have keyboard focus</param>int focusedButtonIndex, public ModalViewModel( string title, string description, bool showCheckBox, string checkBoxLabel, CustomMsgBoxIcon messageBoxIcon, int focusedButtonIndex ) { FocusedButtonIndex = focusedButtonIndex; ModalResult = App.ModalResult.Cancel; Buttons = new List<ModalButton>(); CheckBoxLabel = checkBoxLabel; ShowCheckBox = showCheckBox; Description = description; Icon = messageBoxIcon; Title = title; }