C# Class Xceed.Wpf.Toolkit.MessageBox

Inheritance: System.Windows.Controls.Control
显示文件 Open project: Gainedge/BetterExplorer Class Usage Examples

Public Properties

Property Type Description
ButtonRegionBackgroundProperty System.Windows.DependencyProperty
CancelButtonContentProperty System.Windows.DependencyProperty
CancelButtonStyleProperty System.Windows.DependencyProperty
ImageSourceProperty System.Windows.DependencyProperty
NoButtonContentProperty System.Windows.DependencyProperty
NoButtonStyleProperty System.Windows.DependencyProperty
OkButtonContentProperty System.Windows.DependencyProperty
OkButtonStyleProperty System.Windows.DependencyProperty
TextProperty System.Windows.DependencyProperty
YesButtonContentProperty System.Windows.DependencyProperty
YesButtonStyleProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
Button_Click void
Close void
CreateContainer System.Windows.Window
ExecuteCopy void
GetDefaultButton System.Windows.Controls.Button
GetDefaultButtonFromDefaultResult System.Windows.Controls.Button
GetMessageBoxButton System.Windows.Controls.Button
InitHandlers void
IsCurrentWindow bool
MessageBox System
OnClose void
OnContainerClosed void
SetDefaultResult void
SetImageSource void
ShowCore MessageBoxResult
ShowMessageBoxCore void
UpdateBlockMouseInputsPanel void

Public Methods

Method Description
OnApplyTemplate ( ) : void

Overrides the OnApplyTemplate method.

Show ( Window owner, string messageText ) : MessageBoxResult

Displays a message box that has a message and that returns a result.

Show ( Window owner, string messageText, string caption ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, System.Windows.Style messageBoxStyle ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, MessageBoxButton button, System.Windows.Style messageBoxStyle ) : MessageBoxResult
Show ( Window owner, string messageText, string caption, System.Windows.Style messageBoxStyle ) : MessageBoxResult
Show ( string messageText ) : MessageBoxResult

Displays a message box that has a message and that returns a result.

Show ( string messageText, string caption ) : MessageBoxResult

Displays a message box that has a message and title bar caption; and that returns a result.

Show ( string messageText, string caption, MessageBoxButton button ) : MessageBoxResult
Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : MessageBoxResult
Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult

Displays a message box that has a message and that returns a result.

Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, System.Windows.Style messageBoxStyle ) : MessageBoxResult

Displays a message box that has a message and that returns a result.

Show ( string messageText, string caption, MessageBoxButton button, System.Windows.Style messageBoxStyle ) : MessageBoxResult

Displays a message box that has a message and that returns a result.

ShowDialog ( ) : bool?

Display the MessageBox window and returns only when this MessageBox closes.

ShowMessageBox ( ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

ShowMessageBox ( string messageText ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

ShowMessageBox ( string messageText, string caption ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

ShowMessageBox ( string messageText, string caption, MessageBoxButton button ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

ShowMessageBox ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

ShowMessageBox ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : void

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.

Protected Methods

Method Description
ChangeVisualState ( string name, bool useTransitions ) : void

Changes the control's visual state(s).

InitializeMessageBox ( Window owner, string text, string caption, MessageBoxButton button, MessageBoxImage image, MessageBoxResult defaultResult ) : void

Initializes the MessageBox.

OnCloseButtonClicked ( RoutedEventArgs e ) : void

Processes the close button click.

OnClosed ( EventArgs e ) : void
OnCoerceCloseButtonVisibility ( Visibility newValue ) : object
OnCoerceWindowStyle ( WindowStyle newValue ) : object
OnHeaderDragDelta ( System.Windows.Controls.Primitives.DragDeltaEventArgs e ) : void

Processes the move of a drag operation on the header.

OnHeaderIconDoubleClicked ( MouseButtonEventArgs e ) : void

Processes the double-click on the header.

Private Methods

Method Description
Button_Click ( object sender, RoutedEventArgs e ) : void

Sets the MessageBoxResult according to the button pressed and then closes the MessageBox.

Close ( ) : void

Closes the MessageBox.

CreateContainer ( ) : Window

Creates the container which will host the MessageBox control.

ExecuteCopy ( object sender, ExecutedRoutedEventArgs e ) : void
GetDefaultButton ( ) : System.Windows.Controls.Button

Gets the default button.

Used when the _defaultResult is set to None

GetDefaultButtonFromDefaultResult ( ) : System.Windows.Controls.Button

Gets the default button from the _defaultResult.

GetMessageBoxButton ( string name ) : System.Windows.Controls.Button

Gets a message box button.

InitHandlers ( ) : void
IsCurrentWindow ( object windowtoTest ) : bool
MessageBox ( ) : System
OnClose ( ) : void
OnContainerClosed ( object sender, EventArgs e ) : void

Callack to the Container.Closed event

SetDefaultResult ( ) : void

Sets the button that represents the _defaultResult to the default button and gives it focus.

SetImageSource ( MessageBoxImage image ) : void

Sets the message image source.

ShowCore ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult

Shows the MessageBox.

ShowMessageBoxCore ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : void
UpdateBlockMouseInputsPanel ( ) : void

Method Details

ChangeVisualState() protected method

Changes the control's visual state(s).
protected ChangeVisualState ( string name, bool useTransitions ) : void
name string name of the state
useTransitions bool True if state transitions should be used.
return void

InitializeMessageBox() protected method

Initializes the MessageBox.
protected InitializeMessageBox ( Window owner, string text, string caption, MessageBoxButton button, MessageBoxImage image, MessageBoxResult defaultResult ) : void
owner System.Windows.Window
text string The text.
caption string The caption.
button MessageBoxButton The button.
image MessageBoxImage The image.
defaultResult MessageBoxResult
return void

OnApplyTemplate() public method

Overrides the OnApplyTemplate method.
public OnApplyTemplate ( ) : void
return void

OnCloseButtonClicked() protected method

Processes the close button click.
protected OnCloseButtonClicked ( RoutedEventArgs e ) : void
e System.Windows.RoutedEventArgs The instance containing the event data.
return void

OnClosed() protected method

protected OnClosed ( EventArgs e ) : void
e System.EventArgs
return void

OnCoerceCloseButtonVisibility() protected method

protected OnCoerceCloseButtonVisibility ( Visibility newValue ) : object
newValue Visibility
return object

OnCoerceWindowStyle() protected method

protected OnCoerceWindowStyle ( WindowStyle newValue ) : object
newValue WindowStyle
return object

OnHeaderDragDelta() protected method

Processes the move of a drag operation on the header.
protected OnHeaderDragDelta ( System.Windows.Controls.Primitives.DragDeltaEventArgs e ) : void
e System.Windows.Controls.Primitives.DragDeltaEventArgs The instance containing the event data.
return void

OnHeaderIconDoubleClicked() protected method

Processes the double-click on the header.
protected OnHeaderIconDoubleClicked ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs The instance containing the event data.
return void

Show() public static method

Displays a message box that has a message and that returns a result.
public static Show ( Window owner, string messageText ) : MessageBoxResult
owner System.Windows.Window A System.Windows.Window that represents the owner of the MessageBox
messageText string A System.String that specifies the text to display.
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
defaultResult MessageBoxResult
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
defaultResult MessageBoxResult
messageBoxStyle System.Windows.Style
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, System.Windows.Style messageBoxStyle ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
messageBoxStyle System.Windows.Style
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, MessageBoxButton button, System.Windows.Style messageBoxStyle ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
button MessageBoxButton
messageBoxStyle System.Windows.Style
return MessageBoxResult

Show() public static method

public static Show ( Window owner, string messageText, string caption, System.Windows.Style messageBoxStyle ) : MessageBoxResult
owner System.Windows.Window
messageText string
caption string
messageBoxStyle System.Windows.Style
return MessageBoxResult

Show() public static method

Displays a message box that has a message and that returns a result.
public static Show ( string messageText ) : MessageBoxResult
messageText string A System.String that specifies the text to display.
return MessageBoxResult

Show() public static method

Displays a message box that has a message and title bar caption; and that returns a result.
public static Show ( string messageText, string caption ) : MessageBoxResult
messageText string A System.String that specifies the text to display.
caption string A System.String that specifies the title bar caption to display.
return MessageBoxResult

Show() public static method

public static Show ( string messageText, string caption, MessageBoxButton button ) : MessageBoxResult
messageText string
caption string
button MessageBoxButton
return MessageBoxResult

Show() public static method

public static Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : MessageBoxResult
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
return MessageBoxResult

Show() public static method

public static Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
defaultResult MessageBoxResult
return MessageBoxResult

Show() public static method

Displays a message box that has a message and that returns a result.
public static Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult
messageText string A System.String that specifies the text to display.
caption string A System.String that specifies the title bar caption to display.
button MessageBoxButton A System.Windows.MessageBoxButton value that specifies which button or buttons to display.
icon MessageBoxImage
defaultResult MessageBoxResult A System.Windows.MessageBoxResult value that specifies the default result of the MessageBox.
messageBoxStyle System.Windows.Style A Style that will be applied to the MessageBox instance.
return MessageBoxResult

Show() public static method

Displays a message box that has a message and that returns a result.
public static Show ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, System.Windows.Style messageBoxStyle ) : MessageBoxResult
messageText string A System.String that specifies the text to display.
caption string A System.String that specifies the title bar caption to display.
button MessageBoxButton A System.Windows.MessageBoxButton value that specifies which button or buttons to display.
icon MessageBoxImage
messageBoxStyle System.Windows.Style A Style that will be applied to the MessageBox instance.
return MessageBoxResult

Show() public static method

Displays a message box that has a message and that returns a result.
public static Show ( string messageText, string caption, MessageBoxButton button, System.Windows.Style messageBoxStyle ) : MessageBoxResult
messageText string A System.String that specifies the text to display.
caption string A System.String that specifies the title bar caption to display.
button MessageBoxButton A System.Windows.MessageBoxButton value that specifies which button or buttons to display.
messageBoxStyle System.Windows.Style A Style that will be applied to the MessageBox instance.
return MessageBoxResult

ShowDialog() public method

Display the MessageBox window and returns only when this MessageBox closes.
public ShowDialog ( ) : bool?
return bool?

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( ) : void
return void

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( string messageText ) : void
messageText string
return void

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( string messageText, string caption ) : void
messageText string
caption string
return void

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( string messageText, string caption, MessageBoxButton button ) : void
messageText string
caption string
button MessageBoxButton
return void

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon ) : void
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
return void

ShowMessageBox() public method

Displays this message box when embedded in a WindowContainer parent. Note that this call is not blocking and that you must register to the Closed event in order to handle the dialog result, if any.
public ShowMessageBox ( string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : void
messageText string
caption string
button MessageBoxButton
icon MessageBoxImage
defaultResult MessageBoxResult
return void

Property Details

ButtonRegionBackgroundProperty public_oe static_oe property

public static DependencyProperty,System.Windows ButtonRegionBackgroundProperty
return System.Windows.DependencyProperty

CancelButtonContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows CancelButtonContentProperty
return System.Windows.DependencyProperty

CancelButtonStyleProperty public_oe static_oe property

public static DependencyProperty,System.Windows CancelButtonStyleProperty
return System.Windows.DependencyProperty

ImageSourceProperty public_oe static_oe property

public static DependencyProperty,System.Windows ImageSourceProperty
return System.Windows.DependencyProperty

NoButtonContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows NoButtonContentProperty
return System.Windows.DependencyProperty

NoButtonStyleProperty public_oe static_oe property

public static DependencyProperty,System.Windows NoButtonStyleProperty
return System.Windows.DependencyProperty

OkButtonContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows OkButtonContentProperty
return System.Windows.DependencyProperty

OkButtonStyleProperty public_oe static_oe property

public static DependencyProperty,System.Windows OkButtonStyleProperty
return System.Windows.DependencyProperty

TextProperty public_oe static_oe property

public static DependencyProperty,System.Windows TextProperty
return System.Windows.DependencyProperty

YesButtonContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows YesButtonContentProperty
return System.Windows.DependencyProperty

YesButtonStyleProperty public_oe static_oe property

public static DependencyProperty,System.Windows YesButtonStyleProperty
return System.Windows.DependencyProperty