C# Class Microsoft.Phone.Controls.CustomMessageBox

Inheritance: System.Windows.Controls.ContentControl
显示文件 Open project: Kinnara/WPToolkit Class Usage Examples

Public Properties

Property Type Description
CaptionProperty System.Windows.DependencyProperty
IsFullScreenProperty System.Windows.DependencyProperty
IsLeftButtonEnabledProperty System.Windows.DependencyProperty
IsRightButtonEnabledProperty System.Windows.DependencyProperty
LeftButtonContentProperty System.Windows.DependencyProperty
MessageProperty System.Windows.DependencyProperty
RightButtonContentProperty System.Windows.DependencyProperty
TitleProperty System.Windows.DependencyProperty

Public Methods

Method Description
CustomMessageBox ( ) : System

Initializes a new instance of the CustomMessageBox class.

Dismiss ( ) : void

Dismisses the message box.

OnApplyTemplate ( ) : void

Gets the template parts and attaches event handlers. Animates the message box when the template is applied to it.

Show ( ) : void

Reveals the message box by inserting it into a popup and opening it.

Private Methods

Method Description
ClosePopup ( bool restoreOriginalValues ) : void

Closes the pop up.

CustomMessageBox_LayoutUpdated ( object sender, EventArgs e ) : void

Called when the visual layout changes.

Dismiss ( CustomMessageBoxResult source, bool useTransition ) : void

Dismisses the message box.

GetPageOrientation ( ) : PageOrientation

Gets the current page orientation.

GetTransform ( ) : Transform

Gets a transform for popup elements based on the current page orientation.

GetTransformedRect ( ) : Rect

Gets a rectangle that occupies the entire page.

GetVisibilityFromObject ( Object obj ) : Visibility

Returns a visibility value based on the value of an object.

GetVisibilityFromString ( string str ) : Visibility

Returns a visibility value based on the value of a string.

IsLandscape ( PageOrientation orientation ) : bool

Determines whether the orientation is landscape.

LeftButton_Click ( object sender, RoutedEventArgs e ) : void

Dismisses the message box with the left button.

OnBackKeyPress ( object sender, System e ) : void

Called when the back key is pressed. This event handler cancels the backward navigation and dismisses the message box.

OnCaptionPropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Changes the visibility of the caption text block based on its content.

OnIsFullScreenPropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Modifies the vertical alignment of the message box depending on whether it should occupy the full screen or not.

OnLeftButtonContentPropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Changes the visibility of the left button based on its content.

OnMessagePropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Changes the visibility of the message text block based on its content.

OnNavigating ( object sender, System e ) : void

Called when the application frame is navigating. This event handler dismisses the message box.

OnOrientationChanged ( object sender, OrientationChangedEventArgs e ) : void

Called when the current page changes orientation.

OnRightButtonContentPropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Changes the visibility of the right button based on its content.

OnTitlePropertyChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Changes the visibility of the title text block based on its content.

RightButton_Click ( object sender, RoutedEventArgs e ) : void

Dismisses the message box with the right button.

SetSizeAndOffset ( ) : void

Sets The vertical and horizontal offset of the popup, as well as the size of its child container.

Method Details

CustomMessageBox() public method

Initializes a new instance of the CustomMessageBox class.
public CustomMessageBox ( ) : System
return System

Dismiss() public method

Dismisses the message box.
public Dismiss ( ) : void
return void

OnApplyTemplate() public method

Gets the template parts and attaches event handlers. Animates the message box when the template is applied to it.
public OnApplyTemplate ( ) : void
return void

Show() public method

Reveals the message box by inserting it into a popup and opening it.
public Show ( ) : void
return void

Property Details

CaptionProperty public_oe static_oe property

Identifies the Caption dependency property.
public static DependencyProperty,System.Windows CaptionProperty
return System.Windows.DependencyProperty

IsFullScreenProperty public_oe static_oe property

Identifies the IsFullScreen dependency property.
public static DependencyProperty,System.Windows IsFullScreenProperty
return System.Windows.DependencyProperty

IsLeftButtonEnabledProperty public_oe static_oe property

Identifies the IsLeftButtonEnabled dependency property.
public static DependencyProperty,System.Windows IsLeftButtonEnabledProperty
return System.Windows.DependencyProperty

IsRightButtonEnabledProperty public_oe static_oe property

Identifies the IsRightButtonEnabled dependency property.
public static DependencyProperty,System.Windows IsRightButtonEnabledProperty
return System.Windows.DependencyProperty

LeftButtonContentProperty public_oe static_oe property

Identifies the LeftButtonContent dependency property.
public static DependencyProperty,System.Windows LeftButtonContentProperty
return System.Windows.DependencyProperty

MessageProperty public_oe static_oe property

Identifies the Message dependency property.
public static DependencyProperty,System.Windows MessageProperty
return System.Windows.DependencyProperty

RightButtonContentProperty public_oe static_oe property

Identifies the RightButtonContent dependency property.
public static DependencyProperty,System.Windows RightButtonContentProperty
return System.Windows.DependencyProperty

TitleProperty public_oe static_oe property

Identifies the Title dependency property.
public static DependencyProperty,System.Windows TitleProperty
return System.Windows.DependencyProperty