C# Class ModernWPF.Controls.MessageBoxControl

A base message box type DialogControl with custom content. A message box has built-in messagebox icon/caption/buttons.
Inheritance: DialogControl
显示文件 Open project: soukoku/ModernWPF

Public Properties

Property Type Description
ContentMaxWidthProperty System.Windows.DependencyProperty
ContentMinWidthProperty System.Windows.DependencyProperty

Public Methods

Method Description
OnApplyTemplate ( ) : void

When overridden in a derived class, is invoked whenever application code or internal processes call M:System.Windows.FrameworkElement.ApplyTemplate.

ShowDialogModal ( DialogControlContainer owner, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult

Shows the dialog with icon/caption/buttons.

ShowDialogModal ( Window owner, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult

Shows the dialog modal.

Protected Methods

Method Description
OnClosing ( MessageBoxResult result ) : bool

Called when a non-cancel button is pressed and the control needs to verify if the result is allowed.

OnFocus ( ) : void

Called when dialog has been shown and focus needs to happen.

Private Methods

Method Description
ApplyOptions ( ) : void
MessageBoxControl ( ) : System
_btnCancel_Click ( object sender, RoutedEventArgs e ) : void
_btnNo_Click ( object sender, RoutedEventArgs e ) : void
_btnOK_Click ( object sender, RoutedEventArgs e ) : void
_btnYes_Click ( object sender, RoutedEventArgs e ) : void

Method Details

OnApplyTemplate() public method

When overridden in a derived class, is invoked whenever application code or internal processes call M:System.Windows.FrameworkElement.ApplyTemplate.
public OnApplyTemplate ( ) : void
return void

OnClosing() protected method

Called when a non-cancel button is pressed and the control needs to verify if the result is allowed.
protected OnClosing ( MessageBoxResult result ) : bool
result MessageBoxResult The result.
return bool

OnFocus() protected method

Called when dialog has been shown and focus needs to happen.
protected OnFocus ( ) : void
return void

ShowDialogModal() public method

Shows the dialog with icon/caption/buttons.
public ShowDialogModal ( DialogControlContainer owner, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
owner DialogControlContainer A to host this message box.
caption string The caption.
button MessageBoxButton The button to display.
icon MessageBoxImage The icon to display.
defaultResult MessageBoxResult The default result.
return MessageBoxResult

ShowDialogModal() public method

Shows the dialog modal.
public ShowDialogModal ( Window owner, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult ) : MessageBoxResult
owner System.Windows.Window A that contains in its visual tree.
caption string The caption.
button MessageBoxButton The button to display.
icon MessageBoxImage The icon to display.
defaultResult MessageBoxResult The default result.
return MessageBoxResult

Property Details

ContentMaxWidthProperty public_oe static_oe property

The dependency property for ContentMaxWidth.
public static DependencyProperty,System.Windows ContentMaxWidthProperty
return System.Windows.DependencyProperty

ContentMinWidthProperty public_oe static_oe property

The dependency property for ContentMinWidth.
public static DependencyProperty,System.Windows ContentMinWidthProperty
return System.Windows.DependencyProperty