Intersoft ClientUI Documentation
UXDialogBox Class
Members  Example 



Provides a modal dialog box window to obtain user input.
Object Model
UXDialogBox ClassApplicationPackage ClassISFramework ClassUXContextMenu ClassUXContextMenu Class
Syntax
<DescriptionAttribute("Provides a modal dialog box window to obtain user input.")>
Public Class UXDialogBox 
   Inherits UXWindow
   Implements Intersoft.Client.Framework.IApplicationHostIntersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.IModalWindowIntersoft.Client.Framework.IWindow 
Dim instance As UXDialogBox
[DescriptionAttribute("Provides a modal dialog box window to obtain user input.")]
public class UXDialogBox : UXWindow, Intersoft.Client.Framework.IApplicationHostIntersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.IModalWindowIntersoft.Client.Framework.IWindow  
[DescriptionAttribute("Provides a modal dialog box window to obtain user input.")]
public ref class UXDialogBox : public UXWindow, Intersoft.Client.Framework.IApplicationHostIntersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.IModalWindowIntersoft.Client.Framework.IWindow  
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.

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.
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.
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");
            }
        });
}
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.Editors.UXPropertyGridCollectionEditorDialog
                              Intersoft.Client.UI.Editors.UXPropertyGridCustomEditorDialog
                              Intersoft.Client.UI.ScheduleView.Views.DeleteRecurringEventConfirmation

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

UXDialogBox Members
Intersoft.Client.UI.Aqua.UXDesktop Namespace
Window and Dialog Boxes Overview

Send Feedback