Beispiel #1
0
        /// <summary>
        /// Displays the Cairo Message Dialog with OK/Cancel buttons, implicit settings, custom image and button text.
        /// </summary>
        /// <param name="message">The message to display.</param>
        /// <param name="title">The title of the dialog.</param>
        /// <param name="ImageSource">The path to the image for the dialog.</param>
        /// <param name="OkButtonText">The text for the OK button.</param>
        /// <param name="CancelButtonText">The text for the cancel button.</param>
        /// <returns>Nullable bool indicating the user response.</returns>
        public static bool?ShowOkCancel(string message, string title, string ImageSource, string OkButtonText, string CancelButtonText)
        {
            if (string.IsNullOrEmpty(CancelButtonText))
            {
                CancelButtonText = "Cancel";
            }

            if (string.IsNullOrEmpty(OkButtonText))
            {
                OkButtonText = "OK";
            }

            if (string.IsNullOrEmpty(ImageSource))
            {
                ImageSource = "Resources/cairoIcon.png";
            }

            CairoMessage msgDialog = new CairoMessage();

            msgDialog.Message                 = message;
            msgDialog.Title                   = title;
            msgDialog.Buttons                 = MessageBoxButton.OKCancel;
            msgDialog.OkButton.Content        = OkButtonText;
            msgDialog.CancelButton.Content    = CancelButtonText;
            msgDialog.MessageIconImage.Source = new BitmapImage(new System.Uri(ImageSource, System.UriKind.RelativeOrAbsolute));

            return(msgDialog.ShowDialog());
        }
Beispiel #2
0
        /// <summary>
        /// Displays the Cairo Message Dialog with the default Ok/Cancel button and Icon.
        /// </summary>
        /// <param name="message">The message to display.</param>
        /// <param name="title">The title of the dialog.</param>
        /// <returns>Nullable bool indicating user response.</returns>
        public static bool?Show(string message, string title)
        {
            CairoMessage msgDialog = new CairoMessage();

            msgDialog.Message = message;
            msgDialog.Title   = title;
            msgDialog.Image   = MessageBoxImage.None;
            msgDialog.Buttons = MessageBoxButton.OKCancel;

            return(msgDialog.ShowDialog());
        }
Beispiel #3
0
        /// <summary>
        /// Displays the Cairo Message Dialog with implicit settings.
        /// </summary>
        /// <param name="message">The message to display.</param>
        /// <param name="title">The title of the dialog.</param>
        /// <param name="buttons">The buttons configuration to use.</param>
        /// <param name="image">The image to display.</param>
        /// <returns>Nullable bool indicating user response.</returns>
        public static bool?Show(string message, string title, MessageBoxButton buttons, MessageBoxImage image)
        {
            CairoMessage msgDialog = new CairoMessage();

            msgDialog.Message = message;
            msgDialog.Title   = title;
            msgDialog.Image   = image;
            msgDialog.Buttons = buttons;

            return(msgDialog.ShowDialog());
        }