Skip to end of metadata
Go to start of metadata

Remarks

The UXPage class enables you to easily create a Silverlight application that supports navigation. You use the UXPage class to create pieces of content that support navigation from within a UXFrame. The UXPage represents discrete sections of navigable content, while the UXFrame control acts as a container for the page controls which is also referred as navigation host, and facilitates navigation to pages.

For more information, see Navigation Overview.

Example

The following example shows a how-to implement a UXPage by creating a new XAML page and define themarkup as the root type of the XAML.

 

XAML

Definition

public class UXPage : Page,

IDisposable, IWindowHost, ISupportAuthentication

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXPage Constructor()Initializes a new instance of UXPage class.

Public Properties

AutoDisposeDataContextGets or sets a value indicating whether the data context should be automatically disposed when the page is disposed.
BlockUIOnBusyGets or sets a value indicating whether the UI elements in the page should be disabled when UXPage property is true.
CancelNavigationOnDataErrorGets or sets a value indicating whether navigating from this page should be cancelled if an error existed in the page.
CornerRadiusRepresents the radii of the page border which value is used to determine HeaderCornerRadius and FooterCornerRadius.
DefaultFocusSpecifies the default UI control to be focused when the page is loaded.
FooterCornerRadiusRepresents the inner radii of the border which can be applied to footer element of the page.
HeaderCornerRadiusRepresents the inner radii of the border which can be applied to header element of the page.
IsAuthenticatedGets a value indicating whether the associated UXPage is authenticated.
IsBusyGets or sets a value indicating whether the page is currently processing a task such as asynchronous data retrieval.
IsLoadedReturns a boolean value indicating whether the page has been completely loaded.
NavigatedCommandGets or sets the command to execute when the UXFrame navigates to this page.
NavigationContextExtendedGets the navigation context for this page
NavigationServiceExtendedGets the navigation service for this page
RequiresAuthenticationGets or sets a value indicating whether the page requires the UXPage to be authenticated in order to access the page.
RequiresRoleGets or sets the roles required by the UXPage to display the page.
UserGets or sets the System.Security.Principal.IPrincipal object representing the user that participates in the page authentication.
UseSingleSignOnGets or sets a value indicating whether the page is automatically authenticated when previous authentication succeeded.
WindowCanCloseGets or sets a value indicating whether the window can be closed.
WindowCanMaximizeGets or sets a value indicating whether the window can be maximized.
WindowCanMinimizeGets or sets a value indicating whether the window can be minimized.
WindowCanResizeGets or sets a value indicating whether the window can be resized.
WindowGroupNameGets or sets the group name for the window.
WindowHeightGets or sets the window's height.
WindowIconGets or sets the window's icon.
WindowIconLargeGets or sets the window's large icon.
WindowLeftGets or sets the left position of the window.
WindowMaxHeightGets or sets the window's maximum height.
WindowMaxWidthGets or sets the window's maximum width.
WindowMinHeightGets or sets the window's minimum height.
WindowMinWidthGets or sets the window's minimum width.
WindowTitleGets or sets the window's title.
WindowTopGets or sets the top position of the window.
WindowUseDefaultChromeGets or sets a value indicating whether the window should use default chrome style.
WindowUseNavigationUIGets or sets a value indicating whether the navigation UI should be displayed in navigation window.
WindowWidthGets or sets the window's width.

Fields

AutoDisposeDataContextPropertyIdentifies the AutoDisposeDataContext dependency property.
BlockUIOnBusyPropertyIdentifies the BlockUIOnBusy dependency property.
CancelNavigationOnDataErrorPropertyIdentifies the CancelNavigationOnDataError dependency property.
CornerRadiusPropertyIdentifies the IsBusy dependency property.
DefaultFocusPropertyIdentifies the DefaultFocus dependency property.
FooterCornerRadiusPropertyIdentifies the FooterCornerRadius dependency property.
HeaderCornerRadiusPropertyIdentifies the HeaderCornerRadius dependency property.
IsAuthenticatedPropertyIdentifies the IsAuthenticated dependency property.
IsBusyPropertyIdentifies the IsBusy dependency property.
NavigatedCommandPropertyIdentifies the NavigatedCommand dependency property.
RequiresAuthenticationPropertyIdentifies the RequiresAuthentication dependency property.
RequiresRolePropertyIdentifies the RequiresRole dependency property.
UserPropertyIdentifies the User dependency property.
UseSingleSignOnPropertyIdentifies the UseSingleSignOn dependency property.
WindowCanClosePropertyIdentifies the WindowCanClose dependency property.
WindowCanMaximizePropertyIdentifies the WindowCanMaximize dependency property.
WindowCanMinimizePropertyIdentifies the WindowCanMinimize dependency property.
WindowCanResizePropertyIdentifies the WindowCanResize dependency property.
WindowGroupNamePropertyIdentifies the WindowGroupName dependency property.
WindowHeightPropertyIdentifies the WindowHeightProperty dependency property.
WindowIconLargePropertyIdentifies the WindowIconLarge dependency property.
WindowIconPropertyIdentifies the WindowIconProperty dependency property.
WindowLeftPropertyIdentifies the WindowLeft dependency property.
WindowMaxHeightPropertyIdentifies the WindowMaxHeight dependency property.
WindowMaxWidthPropertyIdentifies the WindowMaxWidth dependency property.
WindowMinHeightPropertyIdentifies the WindowMinHeight dependency property.
WindowMinWidthPropertyIdentifies the WindowMinWidth dependency property.
WindowTaskbarIconPropertyIdentifies the WindowTaskbarIconProperty dependency property.
WindowTitlePropertyIdentifies the WindowTitleProperty dependency property.
WindowTopPropertyIdentifies the WindowTop dependency property.
WindowUseDefaultChromePropertyIdentifies the WindowUseDefaultChrome dependency property.
WindowUseNavigationUIPropertyIdentifies the WindowUseNavigationUI dependency property.
WindowWidthPropertyIdentifies the WindowWidthProperty dependency property.

Public Methods

Dispose()Called when the object is disposed.
GetNavigator()Gets the navigation control that hosts this page.
GetWindowHost()Gets the IWindow object that hosts this page.

Protected Methods

OnApplicationInitialized(ApplicationEventArgs)Called when the ApplicationPackage which this page belongs is initialized for the first time.
OnChildNavigation(ChildNavigationEventArgs) 
OnNavigatedFrom(NavigationEventArgs)Called when the page is no longer the active page in the navigation frame.
OnNavigatedFrom(NavigationEventArgs)Called when the page is no longer the active page in the navigation frame.
OnNavigatedTo(NavigationEventArgs)Called when the page becomes the active content in the navigation frame.
OnNavigatedTo(NavigationEventArgs)Called when the page becomes the active content in the navigation frame.
OnNavigatingFrom(NavigatingCancelEventArgs)Called when the page is being navigated away in the navigation frame.
OnNavigatingFrom(NavigatingCancelEventArgs)Called when the page is being navigated away in the navigation frame.

Events

AuthenticatedOccurs when the the page is successfully authenticated.
RequestingAuthenticationOccurs when the page is requesting authentication.

Public Constructors

public UXPage()

Initializes a new instance of UXPage class.

Public Properties

public bool AutoDisposeDataContext { get; set; }

Gets or sets a value indicating whether the data context should be automatically disposed when the page is disposed.

public bool BlockUIOnBusy { get; set; }

Gets or sets a value indicating whether the UI elements in the page should be disabled when UXPage property is true.

Remarks

In most cases, you may want to block the user interface from being accessible by users when processing a longer operation such as data loading or updating. To do this, you simply set the UXPage property of the page to true. With UXPage enabled, the user interface elements such as text boxes, buttons and other input controls will be automatically disabled when the UXFrame property of the page is set to true. In addition, the cursor will indicate a busy state for the page region which complies to usability standards. For more information, see Advanced Features in ClientUI Navigation Framework.

 

public bool CancelNavigationOnDataError { get; set; }

Gets or sets a value indicating whether navigating from this page should be cancelled if an error existed in the page.

Remarks

For this feature to work properly, the DataContext of the UXPage should implement IDataErrorInfo interface.

 

public CornerRadius CornerRadius { get; set; }

Represents the radii of the page border which value is used to determine HeaderCornerRadius and FooterCornerRadius.

public object DefaultFocus { get; set; }

Specifies the default UI control to be focused when the page is loaded.

public CornerRadius FooterCornerRadius { get; }

Represents the inner radii of the border which can be applied to footer element of the page.

public CornerRadius HeaderCornerRadius { get; }

Represents the inner radii of the border which can be applied to header element of the page.

public bool IsAuthenticated { get; }

Gets a value indicating whether the associated UXPage is authenticated.

public bool IsBusy { get; set; }

Gets or sets a value indicating whether the page is currently processing a task such as asynchronous data retrieval.

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.

 

public bool IsLoaded { get; }

Returns a boolean value indicating whether the page has been completely loaded.

public ICommand NavigatedCommand { get; set; }

Gets or sets the command to execute when the UXFrame navigates to this page.

public NavigationContext NavigationContextExtended { get; }

Gets the navigation context for this page

public NavigationService NavigationServiceExtended { get; }

Gets the navigation service for this page

public bool RequiresAuthentication { get; set; }

Gets or sets a value indicating whether the page requires the UXPage to be authenticated in order to access the page.

Remarks

In many line-of-business scenarios, your application may require certain pages to authenticate against the current user. ClientUI navigation framework includes built-in authentication feature which is implemented at the core navigation process in the UXFrame and UXPage class. This ensures high security protection as the authentication process is built into the framework, which eliminate the need of additional workaround or plumbing code. To implement authentication, you set the UXFrame property of the frame to an object that implements IPrincipal interface. Since the UXFrame property relies on IPrincipal interface which is implemented in the Silverlight runtime, the authentication feature in ClientUI navigation framework allows you to flexibly use any kind of authentication providers such as WCF Authentication Service, or other third party's authentication services. For scalable authentication implementation that produces consistent result, it is recommended that you use MVVM pattern to maintain the user authentication, which is generally achieved by binding the UXFrame property to an authentication context defined in ViewModel. Once you have defined the UXFrame property, you can easily set the pages of which the authentication is required by setting the UXPage property of those pages to true. Role-based security is also supported through the same authentication context that implemented in the UXFrame property. For more information, see Advanced Features in ClientUI Navigation Framework.

 

public string RequiresRole { get; set; }

Gets or sets the roles required by the UXPage to display the page.

Remarks

To enable authentication against users with particular roles, set the UXPage property of the UXPage to the desired role in string value. This feature works in conjunction with UXPage property, which should be set to true as well. For more information, see Advanced Features in ClientUI Navigation Framework.

 

public IPrincipal User { get; set; }

Gets or sets the System.Security.Principal.IPrincipal object representing the user that participates in the page authentication.

public bool UseSingleSignOn { get; set; }

Gets or sets a value indicating whether the page is automatically authenticated when previous authentication succeeded.

public bool WindowCanClose { get; set; }

Gets or sets a value indicating whether the window can be closed.

public bool WindowCanMaximize { get; set; }

Gets or sets a value indicating whether the window can be maximized.

public bool WindowCanMinimize { get; set; }

Gets or sets a value indicating whether the window can be minimized.

public bool WindowCanResize { get; set; }

Gets or sets a value indicating whether the window can be resized.

public string WindowGroupName { get; set; }

Gets or sets the group name for the window.

public double WindowHeight { get; set; }

Gets or sets the window's height.

public Uri WindowIcon { get; set; }

Gets or sets the window's icon.

public Uri WindowIconLarge { get; set; }

Gets or sets the window's large icon.

public double WindowLeft { get; set; }

Gets or sets the left position of the window.

public double WindowMaxHeight { get; set; }

Gets or sets the window's maximum height.

public double WindowMaxWidth { get; set; }

Gets or sets the window's maximum width.

public double WindowMinHeight { get; set; }

Gets or sets the window's minimum height.

public double WindowMinWidth { get; set; }

Gets or sets the window's minimum width.

public string WindowTitle { get; set; }

Gets or sets the window's title.

public double WindowTop { get; set; }

Gets or sets the top position of the window.

public bool WindowUseDefaultChrome { get; set; }

Gets or sets a value indicating whether the window should use default chrome style.

public bool WindowUseNavigationUI { get; set; }

Gets or sets a value indicating whether the navigation UI should be displayed in navigation window.

public double WindowWidth { get; set; }

Gets or sets the window's width.

Fields

public static readonly DependencyProperty AutoDisposeDataContextProperty

Identifies the AutoDisposeDataContext dependency property.

public static readonly DependencyProperty BlockUIOnBusyProperty

Identifies the BlockUIOnBusy dependency property.

public static readonly DependencyProperty CancelNavigationOnDataErrorProperty

Identifies the CancelNavigationOnDataError dependency property.

public static readonly DependencyProperty CornerRadiusProperty

Identifies the IsBusy dependency property.

public static readonly DependencyProperty DefaultFocusProperty

Identifies the DefaultFocus dependency property.

public static readonly DependencyProperty FooterCornerRadiusProperty

Identifies the FooterCornerRadius dependency property.

public static readonly DependencyProperty HeaderCornerRadiusProperty

Identifies the HeaderCornerRadius dependency property.

public static readonly DependencyProperty IsAuthenticatedProperty

Identifies the IsAuthenticated dependency property.

public static readonly DependencyProperty IsBusyProperty

Identifies the IsBusy dependency property.

public static readonly DependencyProperty NavigatedCommandProperty

Identifies the NavigatedCommand dependency property.

public static readonly DependencyProperty RequiresAuthenticationProperty

Identifies the RequiresAuthentication dependency property.

public static readonly DependencyProperty RequiresRoleProperty

Identifies the RequiresRole dependency property.

public static readonly DependencyProperty UserProperty

Identifies the User dependency property.

public static readonly DependencyProperty UseSingleSignOnProperty

Identifies the UseSingleSignOn dependency property.

public static readonly DependencyProperty WindowCanCloseProperty

Identifies the WindowCanClose dependency property.

public static readonly DependencyProperty WindowCanMaximizeProperty

Identifies the WindowCanMaximize dependency property.

public static readonly DependencyProperty WindowCanMinimizeProperty

Identifies the WindowCanMinimize dependency property.

public static readonly DependencyProperty WindowCanResizeProperty

Identifies the WindowCanResize dependency property.

public static readonly DependencyProperty WindowGroupNameProperty

Identifies the WindowGroupName dependency property.

public static readonly DependencyProperty WindowHeightProperty

Identifies the WindowHeightProperty dependency property.

public static readonly DependencyProperty WindowIconLargeProperty

Identifies the WindowIconLarge dependency property.

public static readonly DependencyProperty WindowIconProperty

Identifies the WindowIconProperty dependency property.

public static readonly DependencyProperty WindowLeftProperty

Identifies the WindowLeft dependency property.

public static readonly DependencyProperty WindowMaxHeightProperty

Identifies the WindowMaxHeight dependency property.

public static readonly DependencyProperty WindowMaxWidthProperty

Identifies the WindowMaxWidth dependency property.

public static readonly DependencyProperty WindowMinHeightProperty

Identifies the WindowMinHeight dependency property.

public static readonly DependencyProperty WindowMinWidthProperty

Identifies the WindowMinWidth dependency property.

public static readonly DependencyProperty WindowTaskbarIconProperty

Identifies the WindowTaskbarIconProperty dependency property.

public static readonly DependencyProperty WindowTitleProperty

Identifies the WindowTitleProperty dependency property.

public static readonly DependencyProperty WindowTopProperty

Identifies the WindowTop dependency property.

public static readonly DependencyProperty WindowUseDefaultChromeProperty

Identifies the WindowUseDefaultChrome dependency property.

public static readonly DependencyProperty WindowUseNavigationUIProperty

Identifies the WindowUseNavigationUI dependency property.

public static readonly DependencyProperty WindowWidthProperty

Identifies the WindowWidthProperty dependency property.

Public Methods

public void Dispose()

Called when the object is disposed.

public INavigate GetNavigator()

Gets the navigation control that hosts this page.

Return Types

An object instance that implements INavigate.

 

public IWindow GetWindowHost()

Gets the IWindow object that hosts this page.

Return Types

An object instance that implements IWindow.

 

Protected Methods

protected void OnApplicationInitialized(ApplicationEventArgs e)

Called when the ApplicationPackage which this page belongs is initialized for the first time.

Parameters

 

protected void OnChildNavigation(ChildNavigationEventArgs e)

 

Parameters

e 

 

protected void OnNavigatedFrom(NavigationEventArgs e)

Called when the page is no longer the active page in the navigation frame.

Parameters

e 

 

protected void OnNavigatedFrom(NavigationEventArgs e)

Called when the page is no longer the active page in the navigation frame.

Parameters

e 

 

protected void OnNavigatedTo(NavigationEventArgs e)

Called when the page becomes the active content in the navigation frame.

Remarks

You override the OnNavigatedTo method to examine the navigation request and prepare the page for display. For example, you can load the requested data and enable or disable visual elements. Typically, you use the OnNavigatedTo method instead of creating an event handler for the Loaded event. The OnNavigatedTo method is preferable because it is only called once for each time the page becomes active. The Silverlight framework raises the Loaded event each time the element is added to the visual tree, which potentially can happen more than once when activating a page. The OnNavigatedTo method is called for each request, even when the page is retrieved from the cache. You should include in this method code that must be executed for each request rather than placing that code in the UXPage constructor.

Parameters

e 

 

protected void OnNavigatedTo(NavigationEventArgs e)

Called when the page becomes the active content in the navigation frame.

Remarks

You override the OnNavigatedTo method to examine the navigation request and prepare the page for display. For example, you can load the requested data and enable or disable visual elements. Typically, you use the OnNavigatedTo method instead of creating an event handler for the Loaded event. The OnNavigatedTo method is preferable because it is only called once for each time the page becomes active. The Silverlight framework raises the Loaded event each time the element is added to the visual tree, which potentially can happen more than once when activating a page. The OnNavigatedTo method is called for each request, even when the page is retrieved from the cache. You should include in this method code that must be executed for each request rather than placing that code in the UXPage constructor.

Parameters

e 

 

protected void OnNavigatingFrom(NavigatingCancelEventArgs e)

Called when the page is being navigated away in the navigation frame.

Parameters

e 

 

protected void OnNavigatingFrom(NavigatingCancelEventArgs e)

Called when the page is being navigated away in the navigation frame.

Parameters

e 

 

Events

public event AuthenticationEventHandler Authenticated

Occurs when the the page is successfully authenticated.

public event RequestingAuthenticationEventHandler RequestingAuthentication

Occurs when the page is requesting authentication.

Remarks

When authentication is required for a page, this event is raised to give an opportunity for developers to track and handle the authentication request, such as by providing the RequestingAuthenticationEventArgs value and subsequently set the Handled of the event data to true.
  • No labels