Click or drag to resize
CoronaMessageBox Class

Non-blocking XAML based message box supporting custom button text.

Displayed by Corona via the Lua native.showAlert() function.

Inheritance Hierarchy
SystemObject
  CoronaLabs.Corona.WinRT.PhoneCoronaMessageBox

Namespace: CoronaLabs.Corona.WinRT.Phone
Assembly: CoronaLabs.Corona.DotNet (in CoronaLabs.Corona.DotNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class CoronaMessageBox : IMessageBox

The CoronaMessageBox type exposes the following members.

Constructors
  NameDescription
Public methodCoronaMessageBox

Creates a new message box initialized with empty text and no buttons.

You are expected to set the returned message box's Title, Message, and ButtonLabels properties before showing it.

Top
Methods
  NameDescription
Public methodClose

Closes the message box, if currently shown.

The WasButtonPressed property will be set to false in this case.

Public methodCloseWithButtonIndex
Closes the message box, if currently shown, by simulating a button press.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodShow
Displays the message box using the assigned title, message, and button labels.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyButtonLabels
Gets a modifiable collection of labels to be displayed as buttons in the message box.
Public propertyIsShowing
Determines if the message box is currently being shown to the end-user.
Public propertyMessage
Gets or sets the main text to be displayed in the message box.
Public propertyPressedButtonIndex

Indicates which button was pressed to close the message box.

Note that this property is only applicable if the WasButtonPressed property is set true.

Public propertyStatic memberShownMessagBoxes
Gets a read-only collection of all currently shown message boxes.
Public propertyTitle
Gets or sets the message box's optional title text.
Public propertyWasButtonPressed
Determines if the message box was closed via one of its displayed button.
Top
Events
  NameDescription
Public eventClosed
Raised when the message box has been closed by the end-user via a displayed button, back key, or if one of the Close() methods have been called.
Top
Remarks
Microsoft's built-in Silverlight XAML MessageBox class blocks the main UI thread and does not support customizable buttons. This custom message box is non-blocking and does support multiple buttons (or no buttons) with text of your choosing. With this custom message box, you'll get similar alert dialog behavior as seen on iOS and Android, which makes it easier to port your app via Corona.
See Also