Intersoft ClientUI Documentation
UXDialogBox Class
Members  Example  See Also  Send Feedback
Intersoft.Client.UI.Aqua.UXDesktop Namespace : UXDialogBox Class






Provides a modal dialog box window to obtain user input.

Object Model

UXDialogBox Class

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute("Provides a modal dialog box window to obtain user input.")>
Public Class UXDialogBox 
   Inherits UXWindow
   Implements IApplicationHostIControlIFramework, ILicensing, IModalWindowIWindow 
Visual Basic (Usage)Copy Code
Dim instance As UXDialogBox
C# 
[DescriptionAttribute("Provides a modal dialog box window to obtain user input.")]
public class UXDialogBox : UXWindow, IApplicationHostIControlIFramework, ILicensing, IModalWindowIWindow  
Delphi 
public class UXDialogBox = class(UXWindow, IApplicationHost, IControl, IFramework, ILicensing, IModalWindow, IWindow)
JScript 
DescriptionAttribute("Provides a modal dialog box window to obtain user input.")
public class UXDialogBox extends UXWindow implements IApplicationHostIControlIFramework, ILicensing, IModalWindowIWindow 
Managed Extensions for C++ 
[DescriptionAttribute("Provides a modal dialog box window to obtain user input.")]
public __gc class UXDialogBox : public UXWindow, IApplicationHostIControlIFramework, ILicensing, IModalWindowIWindow  
C++/CLI 
[DescriptionAttribute("Provides a modal dialog box window to obtain user input.")]
public ref class UXDialogBox : public UXWindow, IApplicationHostIControlIFramework, ILicensing, IModalWindowIWindow  

Example

The following example shows how to display a dialog box in standalone mode using ShowDialog API, and handle the closing callback in the code.
C#Copy Code
private void UXButton1_Click(object sender, RoutedEventArgs e)
{
    EditDialogBox dialogBox = new EditDialogBox();
    
    dialogBox.ShowDialog(
        
        // show dialog box in standalone mode
        null,

        // callback handler for the close event
        (dialogResult) =>
        {
            if (dialogResult == Intersoft.Client.Framework.DialogResult.OK)
            {
                MessageBox.Show("The dialog box result is OK");
            }
        });
}
The following example explains how to show a dialog box that is attached to a parent window.
C#Copy Code
private void uXButton1_Click(object sender, RoutedEventArgs e)
{
    EditDialogBox dialogBox = new EditDialogBox();
    UXDesktop currentDesktop = this.GetDesktop();
    
    dialogBox.ShowDialog(
        
        // show dialog box attached to the wndHome.
        currentDesktop.FindWindow("wndHome"),

        // callback handler for the close event
        (dialogResult) =>
        {
            if (dialogResult == Intersoft.Client.Framework.DialogResult.OK)
            {
                MessageBox.Show("The dialog box result is OK");
            }
        });
}

Remarks

A modal dialog box is displayed by a function when the function needs additional data from a user to continue. Because the function depends on the modal dialog box to gather data, the modal dialog box also prevents a user from activating other windows in the application while it remains open. In most cases, a modal dialog box allows a user to signal when they have finished with the modal dialog box by pressing either an OK or Cancel button. The most common examples of modal dialog boxes are shown to open, save, and print data.

A modeless dialog box, on the other hand, does not prevent a user from activating other windows while it is open. For example, if a user wants to find occurrences of a particular word in a document, a main window will often open a dialog box to ask a user what word they are looking for. Since finding a word doesn't prevent a user from editing the document, however, the dialog box doesn't need to be modal. A modeless dialog box at least provides a Close button to close the dialog box, and may provide additional buttons to execute specific functions, such as a Find Next button to find the next word that matches the find criteria of a word search.

ClientUI windowing framework provides a multi-purpose dialog box that you can use to gather user information, or displays specific information. You use a UXDialogBox to represent the content that you want to show in modal mode. By default, UXDialogBox is automatically set to use modal mode. To show the dialog box in modeless mode, set the DialogBoxMode property to Modeless.

Since the dialog box is mostly used to gather user input, UXDialogBox provides a consistent way to obtain the result of the dialog box through DialogResult enumeration. While you can explicitly set the DialogResult property of the dialog box in the Closing event, ClientUI provides a more consistent technique that streamlines the DialogResult value through the properties of ClientUI button controls such as UXButton, UXToolBarButton, and more.

UXDialogBox is typically used in two scenarios: standalone and desktop-integrated mode. In standalone mode, the dialog box will be modal to the entire screen. This means that users can only interact with the content in the dialog box which is commonly seen in login or registration form scenario.

If you are using MVVM pattern, you can use the DialogBoxProvider to create the dialog box in the ViewModel, which is further explained in the Advanced MVVM topic.

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      System.Windows.UIElement
         System.Windows.FrameworkElement
            System.Windows.Controls.Control
               System.Windows.Controls.ContentControl
                  Intersoft.Client.Framework.ISContentControl
                     Intersoft.Client.Framework.ISHeaderedContentControl
                        Intersoft.Client.UI.Aqua.UXDesktop.UXWindow
                           Intersoft.Client.UI.Aqua.UXDesktop.UXDialogBox
                              Intersoft.Client.UI.Aqua.UXDesktop.UXMessageBox
                              Intersoft.Client.UI.ScheduleView.Views.DeleteRecurringEventConfirmation

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.