Exemplo n.º 1
0
        /*!
         *  \brief Show a dialog message with no icon, a window caption and an OK button.
         *
         *  \param owner The owner of the window on which the dialog will be centered.
         *  \param message The message to be shown in the dialog window.
         *  \param caption The title that is displayed in the window's frame.
         *
         *  \return The corresponding button that was pressed, or MessageBoxResult.None
         *  if the window was closed without pushing a button.
         */
        public static MessageBoxResult Show(Window owner, string message, string caption)
        {
            var dialog = new WndDialogMessage()
            {
                Owner = owner, Title = caption ?? ""
            };

            dialog.SetMessage(message);
            dialog.ShowDialog();
            return(dialog.Result);
        }
Exemplo n.º 2
0
        /*!
         *  \brief Show a dialog message with a given icon, a window caption and a given set of buttons.
         *
         *  \param owner The owner of the window on which the dialog will be centered.
         *  \param message The message to be shown in the dialog window.
         *  \param caption The title that is displayed in the window's frame.
         *  \param buttons The button configuration of the dialog window.
         *  \param icon The image icon that should be displayed in the dialog window.
         *
         *  \return The corresponding button that was pressed, or MessageBoxResult.None
         *  if the window was closed without pushing a button.
         */
        public static MessageBoxResult Show(Window owner, string message, string caption, MessageBoxButton buttons, MessageBoxImage icon)
        {
            var dialog = new WndDialogMessage()
            {
                Owner = owner, Title = caption ?? ""
            };

            dialog.SetMessage(message);
            dialog.SetButtons(buttons);
            dialog.SetIconImage(icon);
            dialog.ShowDialog();
            return(dialog.Result);
        }