Intersoft ClientUI Documentation
IsBusy Property (UXPage)
Example 



Gets or sets a value indicating whether the page is currently processing a task such as asynchronous data retrieval.
Syntax
Public Property IsBusy As Boolean
Dim instance As UXPage
Dim value As Boolean
 
instance.IsBusy = value
 
value = instance.IsBusy
public bool IsBusy {get; set;}
public:
property bool IsBusy {
   bool get();
   void set (    bool value);
}
Remarks

ClientUI navigation framework includes built-in busy state management feature which helps to streamline the busy state implementation in your navigation application. You set the IsBusy property of the UXPage to true when the page is processing particular operations, such as asynchronous data retrieval from server. Likewise, you set the IsBusy property to false when the operation has completed.

The busy state management architecture is designed in such a way that intuitive to developers. The UXFrame automatically reacts when the active page propagates the changes of its IsBusy property. Consequently, this significantly reduces development effort by eliminating the needs to implement the busy indicator manually in each page.

With a single dependency property to handle the IsBusy state, this design is also an ideal solution for MVVM pattern development. You can easily bind the IsBusy property to your ViewModel and then execute the operation within your ViewModel. For more information, see Advanced Features in ClientUI Navigation Framework.

For more information about application development with MVVM pattern, see MVVM Pattern Overview.

Example
The following example shows how to work with the busy state management feature in UXFrame and UXPage using the MVVM pattern.
<Intersoft:UXPage
        ... 
        xmlns:Intersoft="http://intersoft.clientui.com/schemas"
        xmlns:ViewModels="clr-namespace:ClientUIBusinessApp1.ViewModels"
        x:Class="ClientUIBusinessApp1.RegisterForm" 
        IsBusy="{Binding Path=IsBusy}">

    <Intersoft:UXPage.DataContext>
        <ViewModels:RegisterFormViewModel/>
    </Intersoft:UXPage.DataContext>

    <Grid x:Name="LayoutRoot">
    ...
    </Grid>
</Intersoft:UXPage>
The following code shows the ViewModel of the RegisterForm that responsible to manage the busy state according to the business logic. Notice that the IsBusy property of the ViewModel is bound to the IsBusy property of the UXPage.
public class RegisterFormViewModel : ValidationViewModelBase
{
    // Fields
    private bool _isBusy = false;


    // Views
    public bool IsBusy
    {
        get
        {
            return _isBusy;
        }
        private set
        {
            if (_isBusy != value)
            {
                _isBusy = value;
                OnPropertyChanged("IsBusy");
            }
        }
    }

        // Methods
        private void ExecuteCreateAccount(object parameter)
    {
        if (this.Validate())
        {
            // Enables the page's busy state.
            // This will block user interaction while the login 
            // is being processed and optionally display busy indicator.
            IsBusy = true;

            // Perform asynchronous server-side call to create user account
            _registrationContext.CreateUser(this.RegistrationData, this.RegistrationData.Password, this.SelectedRoles,
                                            CreateAccount_Completed, null);
        }
        else
        {
            this.FocusErrorField();
        }
    }
  
    ...
}
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

UXPage Class
UXPage Members
Navigation Overview

Send Feedback