Skip to end of metadata
Go to start of metadata

Remarks

UXDesktop is an innovative control featuring sophisticated windows management and powerful application management capabilities. UXDesktop can host a collection of window controls ranging from normal window, modal dialog box, window chrome, and other window UI controls that implement IWindow interface.

With built-in windows management features, UXDesktop maintains the consistency of active window, such as seamlessly deactivates the other windows while a new window becomes active. It also provides numerous industry-standards windowing features such as automatic existing instances detection which enables existing window instance to be activated instead of launching a new window for the same object.

The UXDesktop manages the lifetime of all window instances, which includes the window arrangement, the window state management, the window events and command management.

For more information about using UXDesktop in details, see Window and Dialog Boxes Overview. For more information about advanced windowing topics, see Advanced Window Features.

Example

The following example shows the XAML code to implement a simple desktop-style interface using UXDesktop and UXWindow control.

 

XAML

Working with ActiveWindow Property

The following example shows how to get the active window in the UXDesktop.

C#

Working with ActiveWindowIndex Property

The following example shows how to get the active window index in UXDesktop.

C#

Working with CascadingSpace Property

When the WindowStartupLocation property in UXWindow set to Auto, the desktop manager first checks for the Left and Top property of the window. If an exact location is not specified, the desktop manager automatically calculates the position from the last shown window and position the window cascaded against the previous position. The cascading space can be customized through CascadingSpace property.

The following example shows how to customize the default space between windows through the CascadingSpace property.

XAML

Definition

public class UXDesktop : ISItemsControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXDesktop Constructor()Creates a new instance of UXDesktop class.

Static Properties

CurrentGets the current instance of UXDesktop.

Public Properties

ActiveWindowGets the currently active window in UXDesktop.
ActiveWindowIndexGets or sets the value that indicates the active window index.
CascadingSpaceSpecifies the item spacing for cascading window arrangement.
EnableWindowAnimationDetermines whether window animations such as minimize and maximize should be enabled.
TaskBarSpecifies the taskbar control that implements ITaskBar interface to manage window state, represent and identify running windows.
UriMapperGets or sets the UriMapper object to provide URI mapping capability.

Protected Properties

ProductProduct Info.

Fields

ActiveWindowChangedEventOccurs when the active window is changed.
ActiveWindowChangingEventOccurs when the active window is about to change.
ActiveWindowIndexPropertyIdentifies the ActiveWindowIndex dependency property.
ActiveWindowPropertyIdentifies the ActiveWindow dependency property.
CascadingSpacePropertyIdentifies the CascadingSpace dependency property.
EnableWindowAnimationPropertyIdentifies the EnableWindowAnimation dependency property.
TaskBarPropertyIdentifies the TaskBar dependency property.
UriMapperPropertyIdentifies the UriMapper dependency property.

Public Methods

ActivateWindow(int)Activates the window given its index to the foreground.
ActivateWindow(IWindow)Activates the specified window to the foreground.
CloseWindow(IWindow)Close the specified window.
Dispose() 
FindWindow(string)Returns the IWindow that matches the specified name in this control.
GetShell()Gets the UXShell instance that manages the application lifecycle.
GetVisibleWindows()Gets the collection of visible windows in the UXDesktop.
LaunchApplication(Uri)Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.
LaunchApplication(Uri, object)Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.
LaunchApplication(Uri, bool)Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.
OnApplyTemplate()Builds the visual tree for the UXDesktop when a new template is applied.
OpenNewNavigationWindow(Uri, string)Create a new navigation window, navigate to the specified URI and show the window to the foreground.
OpenNewNavigationWindow(WindowOptions)Create a new navigation window based on the specified options and show the window to the foreground.
RearrangeWindows()Invalidates and re-arrange the windows in the UXDesktop.

Protected Methods

ArrangeOverride(Size)Provides the behavior for the Arrange pass of Silverlight layout.
GetContainerForItemOverride()Creates or identifies the element that is used to display the given item.
IsItemItsOwnContainerOverride(object)Determines if the specified item is (or is eligible to be) its own container.
OnItemsChanged(object, ItemsChangedEventArgs)Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.
PrepareContainerForItemOverride(DependencyObject, object)Prepares the specified element to display the specified item.

Events


Public Constructors

public UXDesktop()

Creates a new instance of UXDesktop class.

Static Properties

public static UXDesktop Current { get; set; }

Gets the current instance of UXDesktop.

Public Properties

public IWindow ActiveWindow { get; set; }

Gets the currently active window in UXDesktop.

public int ActiveWindowIndex { get; set; }

Gets or sets the value that indicates the active window index.

public double CascadingSpace { get; set; }

Specifies the item spacing for cascading window arrangement.

Remarks

When the UXWindow property in UXWindow set to Auto, the desktop manager first checks for the Left and Top property of the window. If an exact location is not specified, the desktop manager automatically calculates the position from the last shown window and position the window cascaded against the previous position. The cascading space can be customized through CascadingSpace property.

 

public bool EnableWindowAnimation { get; set; }

Determines whether window animations such as minimize and maximize should be enabled.

public ITaskBar TaskBar { get; set; }

Specifies the taskbar control that implements ITaskBar interface to manage window state, represent and identify running windows.

public UriMapperBase UriMapper { get; set; }

Gets or sets the UriMapper object to provide URI mapping capability.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly RoutedEvent ActiveWindowChangedEvent

Occurs when the active window is changed.

public static readonly RoutedEvent ActiveWindowChangingEvent

Occurs when the active window is about to change.

public static readonly DependencyProperty ActiveWindowIndexProperty

Identifies the ActiveWindowIndex dependency property.

public static readonly DependencyProperty ActiveWindowProperty

Identifies the ActiveWindow dependency property.

public static readonly DependencyProperty CascadingSpaceProperty

Identifies the CascadingSpace dependency property.

public static readonly DependencyProperty EnableWindowAnimationProperty

Identifies the EnableWindowAnimation dependency property.

public static readonly DependencyProperty TaskBarProperty

Identifies the TaskBar dependency property.

public static readonly DependencyProperty UriMapperProperty

Identifies the UriMapper dependency property.

Public Methods

public void ActivateWindow(int index)

Activates the window given its index to the foreground.

Parameters

indexThe window's index to be activated.

 

public void ActivateWindow(IWindow item)

Activates the specified window to the foreground.

Parameters

itemThe window object to be activated.

 

public void CloseWindow(IWindow item)

Close the specified window.

Parameters

itemThe window to be closed.

 

public void Dispose()

 

public IWindow FindWindow(string name)

Returns the IWindow that matches the specified name in this control.

Parameters

nameThe name of the window to find.

Return Types

A IWindow object.

 

public UXShell GetShell()

Gets the UXShell instance that manages the application lifecycle.

Return Types

A UXShell object.

 

public List<IWindow> GetVisibleWindows()

Gets the collection of visible windows in the UXDesktop.

Return Types

A list of visible windows that implement IWindow interface.

 

public void LaunchApplication(Uri uri)

Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.

Parameters

uriThe URI of the application to be launched.

 

public void LaunchApplication(Uri uri, object parameter)

Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.

Parameters

uriThe URI of the application to be launched.
parameterCustom data/parameter to be passed to the target application during startup.

 

public void LaunchApplication(Uri uri, bool forceSingleInstance)

Launches the application given its URI locator. If the application is not yet downloaded, UXDesktop will automatically download, install and then run the application.

Parameters

uriThe URI of the application to be launched.
forceSingleInstanceWhen set to true, the application will not be launched if an existing instance is already existed.

 

public void OnApplyTemplate()

Builds the visual tree for the UXDesktop when a new template is applied.

public UXNavigationWindow OpenNewNavigationWindow(Uri uri, string windowName)

Create a new navigation window, navigate to the specified URI and show the window to the foreground.

Parameters

uriThe URI for the navigation source.
windowNameThe name associated with the navigation window.

Return Types

A UXNavigationWindow object.

 

public UXNavigationWindow OpenNewNavigationWindow(WindowOptions options)

Create a new navigation window based on the specified options and show the window to the foreground.

Parameters

optionsThe window options that represents the navigation source, navigation bar visibility and other window settings such as Title, Icon and more.

Return Types

A UXNavigationWindow object.

 

public void RearrangeWindows()

Invalidates and re-arrange the windows in the UXDesktop.

Protected Methods

protected Size ArrangeOverride(Size finalSize)

Provides the behavior for the Arrange pass of Silverlight layout.

Parameters

finalSizeThe final area within the parent that this object should use to arrange itself and its children.

Return Types

The actual size used once the element is arranged.

 

protected DependencyObject GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

Return Types

The element that is used to display the given item.

 

protected bool IsItemItsOwnContainerOverride(object item)

Determines if the specified item is (or is eligible to be) its own container.

Parameters

itemThe item to check.

Return Types

true if the item is (or is eligible to be) its own container; otherwise, false.

 

protected void OnItemsChanged(object sender, ItemsChangedEventArgs e)

Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.

Parameters

senderThe System.Object that raised the event.
eNotifyCollectionChangedEventArgs that contains the event data

 

protected void PrepareContainerForItemOverride(DependencyObject element, object item)

Prepares the specified element to display the specified item.

Parameters

elementThe container element used to display the specified item.
itemThe item to display.

 

Events

public event WindowChangeEventHandler ActiveWindowChanged

 

public event WindowChangeEventHandler ActiveWindowChanging

 

public event WindowEventHandler WindowCreating

 

  • No labels