Skip to end of metadata
Go to start of metadata

Remarks

UXWindow is a full-featured windowing control that provides all the user interface elements required in a window suchastitle bar, control box, option buttons, chrome border, content area and more. It gives you complete customization over its look and feel, allowing you to create commercial-class user interface applications.  

The following illustration shows the user interface overview of a window control.

As seen in the above illustration, UXWindow does not only provide the user interface and styles, but also implement the behaviors and user experience aspects such as 8-edge resizing mode, active and inactive state, drag and drop, and context menu.

For more information about user experience implementation in windowing and other ClientUI controls, see User Experiences Overview.

To show a window, you set its IsClientVisible property to true. If you use MVVM pattern development, you can bind this property to control the window's visibility in your ViewModel. For more information about MVVM pattern, see MVVM Pattern Overview.

The following example shows how to show a window when the desktop control is loaded.

XAML
To learn more about UXWindow and its features, see UXWindow Overview.

Example

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

 

XAML

Working with Hide Method

The Hide method used to display the window.

The following example shows how to create a new instance of HomeWindow class and hide the window using API on a button click.

C#

Working with BusyIndicatorTemplate Property

While processing a long running operation, such as in report generation and asynchronous data retrieval scenario, you may want to show a customized busy indicator in addition to the built-in behaviors described in the previous section.

You can add your own busy indicator to be displayed when the window is busy by setting your custom XAML template to the BusyIndicatorTemplate property of the window.

The following example shows how to setup the UXWindow to show a progress bar when the window is busy. This is done by specifying a custom data template to the BusyIndicatorTemplate property.

XAML

Working with ControlBoxPosition Property

The following example shows how to uses ControlBoxPosition for specifies the control box position to be displayed in UXWindow.

XAML

Working with IsActive Property

In desktop-integrated mode, only one window can be active at a time. When a window is set as active, the desktop manager automatically deactivates the previously active window.

When a window is set to active, its visual state will be changed to Active state. The related events such as Deactivated and Activated will be raised consecutively.

The following example shows how to set IsActive property in UXWindow.

XAML

Working with IsBusy Property

The UXWindow control provides built-in busy state management allowing you to create compelling window interface that responsive to user interactions. To set a window as busy, you simply set the IsBusy property to true. In addition, ClientUI also provides similar features for other frameworks such as navigation. To learn more about navigation framework, see Navigation Overview.

Working with IsClientVisible Property

By default, a UXWindow is not automatically shown eventhough it is defined in the UXDesktop control, or when used independently.

To show a window, you set its IsClientVisible property to true. To hide a window using property, you set the IsClientVisible property to false. If you use MVVM pattern development, you can bind this property to control the window's visibility in your ViewModel. For more information about MVVM pattern, see MVVM Pattern Overview.

The following example shows how to show a window when the desktop control is loaded.

XAML

Working with ResizeDirection Property

The following example shows UXWindow control that only can be resize from bottom right of window by setting the ResizeDirection property to BottomRight.

XAML

Working with WindowStartupLocation Property

You can set a window to be automatically positioned to certain location at startup by setting its WindowStartupLocation property. UXWindow exposes three values that you can apply which is explained below:

  • Auto. The window location will be determined automatically, which is the default value.
  • CenterScreen. The window will be positioned in center relative to the screen.
  • CenterOwner. The window will be positioned in center relative to the owner/parent.

When the Auto mode is used, 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 in UXDesktop.

The following example shows how to setup the window to appear with the position centered to the screen.

XAML

Working with WindowState Property

The following example shows how to maximize UXWindow when loaded.

XAML

Definition

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXWindow Constructor()Creates a new instance of UXWindow class.
UXWindow Constructor(string)Initializes a new instance of the UXWindow class with caption.
UXWindow Constructor(string, ImageSource)Initializes a new instance of the UXWindow class with caption and icon.

Public Properties

ApplicationIDGets the unique identifier that represents the application associated to this window.
ApplicationUriGets the unique resource identifier (URI) of the application associated to this window.
BlockUIOnBusyGets or sets a value that indicates whether the UI should be blocked when the window is in busy mode, i.e, loading data or navigating.
BusyIndicatorTemplateGets or sets the template that represents the busy indicator when the UXWindow is true.
BusyTextSpecifies the caption text that displayed when the window is busy.
CanCloseGets or sets a value indicating whether the window can be closed.
CanMaximizeGets or sets a value indicating whether the window can be maximized.
CanMinimizeGets or sets a value indicating whether the window can be minimized to task bar.
CanMoveGets or sets a value indicating whether the window can be moved.
CanResizeGets or sets a value indicating whether the window can be resized.
CloseTextSpecifies the tooltip text for the close button.
CommandBarTemplateGets or sets the template that represents command bar which is placed in the bottom edge of the content area.
ContentBackgroundGets or sets the brush to apply to the background of the window's content.
ContentBorderBrushGets or sets the brush to apply to the border of the window's content.
ContentBorderThicknessGets or sets the border thickness of the window's content element.
ContentMarginGets or sets the margin of the window's content element.
ControlBoxPositionGets or sets a value that indicates the position of the window's control box.
ControlBoxVisibilitySpecifies whether the control box UI of the window is visible or hidden.
CurrentApplicationGets the current application source associated to this window.
DefaultFocusSpecifies the default UI control to be focused when the window is shown.
DropShadowGets or sets the drop shadow effect applied to an active window.
EnableAnimationGets or sets a value indicating whether the window animation should be used when processing certain window operations such as minimize, close, etc.
EnableSystemContextMenuGets or sets a value indicating whether the built-in window context menu is enabled.
GroupNameSpecifies the group name of this window.
HeaderBackgroundGets or sets the brush that applies to the background of the window's header.
HeaderDisplayModeSpecifies the display mode of the content presentation.
HeaderEffectGets or sets the effect to apply to the header element.
HeaderForegroundRepresents the brush that applies to the text color of the header element.
HeaderHorizontalAlignmentGets or sets the horizontal alignment of the control's header content.
HeaderMarginGets or sets the margin of the window's header.
HeaderVerticalAlignmentGets or sets the vertical alignment of the window's header element.
IconGets or sets an image source representing the icon of the window. The recommended image size for Icon is 16x16.
IconLargeGets or sets the large version of the window's icon which commonly used in task bar or other UI that requires large icon display. The recommended image size for IconLarge is 48x48.
IconStretchGets or sets a value that determines the stretching characteristic of the Icon image.
InactiveBackgroundGets or sets the brush to apply to the background element of an inactive window.
InactiveBorderBrushGets or sets the brush to apply to the border element of an inactive window.
InactiveDropShadowGets or sets the drop shadow effect applied to an inactive window.
InnerBackgroundGets or sets the brush to apply to the background of the window's inner border.
InnerBorderBrushGets or sets the brush to apply to the border of the window's inner border.
InnerBorderThicknessGets or sets the value that indicates the thickness of the window's inner border.
InnerCornerRadiusInner corner radius.
IsActiveGets or sets the active state of the window.
IsBusyGets or sets the busy state of the window.
IsClientVisibleSpecifies whether this window is visible at runtime.
IsClosedDetermines whether this window has been closed.
IsDraggedDetermines whether this window is being dragged.
IsResizingDetermines whether this window is being resized.
LeftGets or sets the left position of the window.
MaximizeTextSpecifies the tooltip text for the maximize button.
MinimizeTextSpecifies the tooltip text for the minimize button.
OwnerGets the control that owns this window.
ParentControlGets the visual parent control of this window.
PrimaryToolBarTemplateGets or sets the template that represents toolbar elements which is placed in the window's primary toolbar area.
ResizeDirectionGet or sets a value that controls the direction in which a window can be resized.
ResizeGripVisibilityGets or sets a value indicating whether the window's resize visual hint is visible.
ResizeGripVisibilityResolvedThe calculated value of ResizeGripVisibility used for XAML binding.
ResizeModeGets the current resizing mode.
RestoreDownTextSpecifies the tooltip text for the restore button.
RootElementGets the root element.
RuntimeZIndexGets or sets the z-index order of the window.
SecondaryToolBarTemplateGets or sets the template that represents toolbar elements which is placed in the window's secondary toolbar area.
ShowInTaskbarGets or sets a value that indicates whether the window has a task bar button when opened.
StartupParametersGets the custom data or parameters that transferred by caller during startup process.
SupportedFeaturesRepresents the windowing features supported by this control.
SystemContextMenuStyleGets or sets the style to apply to the system context menu.
SystemIconElementGets the system icon element of the window.
TitleBarGets the title bar element of the window.
TopGets or sets the top position of the window.
TopmostGets or sets a value that indicates whether the window appears in the topmost z-order.
WindowButtonStyleGets or sets the style to apply to the window's option buttons.
WindowContextMenuGets the window context menu.
WindowIDSpecifies the unique identifier (UID) for this window. This property is not intended to be set directly by developers.
WindowNameGets or sets the name that identifies this window when integrated with desktop and task bar.
WindowStartupLocationGets or sets a value that indicates how the window should be positioned during startup.
WindowStateGets or sets the initial state when the window is first displayed.

Protected Properties

ProductProduct Info.
SystemIconElementGets the system icon element of the window.
TitleBarGets the title bar element of the window.
WindowContextMenuGets the window context menu.

Fields

AttachedWindowPropertyGets or sets the value that represents an IWindow object to be attached.
BlockUIOnBusyPropertyIdentifies the BlockUIOnBusy dependency property.
BusyIndicatorTemplatePropertyIdentifies the BusyIndicator dependency property.
BusyTextPropertyIdentifies the BusyText dependency property.
CanClosePropertyIdentifies the CanClose dependency property.
CanMaximizePropertyIdentifies the CanMaximize dependency property.
CanMinimizePropertyIdentifies the CanMinimize dependency property.
CanMovePropertyIdentifies the HeaderDisplayMode dependency property.
CanResizePropertyIdentifies the CanResize dependency property.
CloseTextPropertyIdentifies the CloseText dependency property.
CommandBarTemplatePropertyIdentifies the CommandBarTemplate dependency property.
ContentBackgroundPropertyIdentifies the ContentBackground dependency property.
ContentBorderBrushPropertyIdentifies the ContentBorderBrush dependency property.
ContentBorderThicknessPropertyIdentifies the ContentBorderThickness dependency property.
ContentMarginPropertyIdentifies the ContentMargin dependency property.
ControlBoxPositionPropertyIdentifies the ControlBoxPosition dependency property.
ControlBoxVisibilityPropertyIdentifies the ControlBoxVisibility dependency property.
DefaultFocusPropertyIdentifies the DefaultFocus dependency property.
DropShadowPropertyIdentifies the DropShadow dependency property.
EnableAnimationPropertyIdentifies the EnableAnimation dependency property.
EnableSystemContextMenuPropertyIdentifies the EnableSystemContextMenu dependency property.
HeaderBackgroundPropertyIdentifies the HeaderForeground dependency property.
HeaderDisplayModePropertyIdentifies the HeaderDisplayMode dependency property.
HeaderEffectPropertyIdentifies the HeaderEffect dependency property.
HeaderForegroundPropertyIdentifies the HeaderForeground dependency property.
HeaderHorizontalAlignmentPropertyIdentifies the HeaderHorizontalAlignment dependency property.
HeaderMarginPropertyIdentifies the HeaderMargin dependency property.
HeaderVerticalAlignmentPropertyIdentifies the HeaderVerticalAlignment dependency property.
IconLargePropertyIdentifies the IconLarge dependency property.
IconPropertyIdentifies the Icon dependency property.
IconStretchPropertyIdentifies the IconStretch dependency property.
InactiveBackgroundPropertyIdentifies the InactiveBackground dependency property.
InactiveBorderBrushPropertyIdentifies the InactiveBorderBrush dependency property.
InactiveDropShadowPropertyIdentifies the InactiveDropShadow dependency property.
InnerBackgroundPropertyIdentifies the InnerBackground dependency property.
InnerBorderBrushPropertyIdentifies the InnerBorderBrush dependency property.
InnerBorderThicknessPropertyIdentifies the InnerBorderThickness dependency property.
InnerCornerRadiusPropertyIdentifies the InnerCornerRadius dependency property.
IsActivePropertyIdentifies the IsActive dependency property.
IsBusyPropertyIdentifies the IsBusy dependency property.
IsClientVisiblePropertyIdentifies the IsClientVisible dependency property.
LeftPropertyIdentifies the Left dependency property.
MaximizeTextPropertyIdentifies the MaximizeText dependency property.
MinimizeTextPropertyIdentifies the MinimizeText dependency property.
PrimaryToolBarTemplatePropertyIdentifies the PrimaryToolBarTemplate dependency property.
ResizeDirectionPropertyIdentifies the ResizeDirection dependency property.
ResizeGripVisibilityPropertyIdentifies the ResizeGripVisibility dependency property.
ResizeGripVisibilityResolvedPropertyIdentifies the ResizeGripVisibilityResolved dependency property.
RestoreDownTextPropertyIdentifies the RestoreDownText dependency property.
RuntimeZIndexPropertyIdentifies the RuntimeZIndex dependency property.
SecondaryToolBarTemplatePropertyIdentifies the SecondaryToolBarTemplate dependency property.
ShowInTaskbarPropertyIdentifies the ShowInTaskbar dependency property.
StartupParametersPropertyIdentifies the StartupParameters dependency property.
SystemContextMenuStylePropertyIdentifies the SystemContextMenu dependency property.
TopmostPropertyIdentifies the Topmost dependency property.
TopPropertyIdentifies the Top dependency property.
WindowButtonStylePropertyIdentifies the WindowButtonStyle dependency property.
WindowNamePropertyIdentifies the WindowName dependency property.
WindowStartupLocationPropertyIdentifies the WindowStartupLocation dependency property.
WindowStatePropertyIdentifies the WindowState dependency property.

Static Methods

GetAttachedWindow(DependencyObject)Gets the value of the AttachedWindow property of the specified object.
GetWindowHost(UIElement)Returns a reference to the IWindow object that hosts the content tree within which the UIElement is located.
SetAttachedWindow(DependencyObject, IWindow)Sets the value of the AttachedWindow property of the specified object.

Public Methods

BringToFront()Brings the window to the front of the z-order.
Close()Permanently close the window and releases all the resources allocated by the window.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
Dispose()Called when the object is disposed.
GetCurrentWindowState()Gets the data that represents the current window state.
GetDesktop()Returns the UXDesktop instance that hosts this window.
GetElement(string)Gets the element of the specified part name.
GetImplementationRoot()Gets the implementation root of this control.
GetThumbnail(bool)Returns an ImageSource that represents the thumbnail of the current window's visual.
Hide()Hides the window.
IsFeatureSupported(object)Determines whether a feature is supported by this window class.
Maximize()Maximizes the window to the available screen real estate.
Minimize()Minimizes the window to the task bar. This method will take affect only when the TaskBar property of the window is assigned.
MoveTo(double, double)Moves the window to the specified location.
OnApplyTemplate()Builds the visual tree for the UXWindow when a new template is applied.
ResizeTo(double, double)Resizes the window to the specified dimension.
Restore()Restores the window from minimized or maximized state.
SendToBack()Sends the window to the back of the z-order.
Show()Displays the window.
Show(FrameworkElement)Displays the window and attach it to a specified owner.
UpdateVisualThumbnail()Updates the thumbnail of the current window's visual.

Protected Methods

OnActivated()Called when the window is activated.
OnCanResizeChanged()Called when the CanResize property is changed.
OnClosedCore()Called when the window is closed and ready to be destroyed.
OnCornerRadiusChanged()Called when the value of CornerRadius property changes.
OnDataTemplateChanged(DependencyProperty)Called when one of the data template properties defined in UXWindow is changed.
OnDeactivated()Called when the window is deactivated.
OnGotFocus(RoutedEventArgs)Called before the GotFocus event occurs.
OnIsActiveChanged(bool, bool)Called when the value of IsActive property is changed.
OnIsBusyChanged()Called when the value of IsBusy property is changed.
OnIsClientVisibleChanged()Called when the value of IsClientVisible property has changed.
OnLocationChange(DependencyPropertyChangedEventArgs)Called when the window location is about to change.
OnLocationChanged(double, double)Called when the window location is changed.
OnMouseLeftButtonDown(MouseButtonEventArgs)Overridden.
OnRuntimeZIndexChanged(int)Called when the value of RuntimeZIndex property is changed.
OnTopmostChanged()Called when the value of Topmost property is changed.
OnWindowStateChanged(WindowState, WindowState)Called when the window state is changed.

Events

ActivatedOccurs when a window becomes the foreground window.
BusyChangedOccurs when the busy state of the window is changed.
ClosedOccurs when a window is closed.
ClosingOccurs when a window is about to close.
CreatedOccurs when a window is created and all required window resources are loaded.
DeactivatedOccurs when a window becomes a background window.
DestroyedOccurs when a window is permanently closed and destroyed.
GotKeyboardFocusOccurs when the window or a control in the window receives focus from keyboard device.
LostKeyboardFocusOccurs when the window or a control in the window loses its keyboard focus.
MovedOccurs when a window is moved.
OpenedOccurs when a window is opened for the first time.
OpeningOccurs when a window is about to open for the first time.
ReactivatedOccurs when a window is reactivated from an external ApplicationLaunch command or API.
ResizedOccurs when a window is resized.
SystemContextMenuOccurs when the context menu is requested.
WindowStateChangedOccurs when the state of the window is changed.
WindowStateChangingOccurs when the state of the window is about to change.

Public Constructors

public UXWindow()

Creates a new instance of UXWindow class.

public UXWindow(string caption)

Initializes a new instance of the UXWindow class with caption.

Parameters

captionThe caption of the window.

 

public UXWindow(string caption, ImageSource icon)

Initializes a new instance of the UXWindow class with caption and icon.

Parameters

captionThe caption of the window.
iconThe icon of the window.

 

Public Properties

public object ApplicationID { get; }

Gets the unique identifier that represents the application associated to this window.

public Uri ApplicationUri { get; }

Gets the unique resource identifier (URI) of the application associated to this window.

public bool BlockUIOnBusy { get; set; }

Gets or sets a value that indicates whether the UI should be blocked when the window is in busy mode, i.e, loading data or navigating.

public DataTemplate BusyIndicatorTemplate { get; set; }

Gets or sets the template that represents the busy indicator when the UXWindow is true.

Remarks

While processing a long running operation, such as in report generation and asynchronous data retrieval scenario, you may want to show a customized busy indicator in addition to the built-in behaviors described in the previous section. You can add your own busy indicator to be displayed when the window is busy by setting your custom XAML template to the BusyIndicatorTemplate property of the window.

 

public string BusyText { get; set; }

Specifies the caption text that displayed when the window is busy.

public bool CanClose { get; set; }

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

public bool CanMaximize { get; set; }

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

public bool CanMinimize { get; set; }

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

public bool CanMove { get; set; }

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

public bool CanResize { get; set; }

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

public string CloseText { get; set; }

Specifies the tooltip text for the close button.

public DataTemplate CommandBarTemplate { get; set; }

Gets or sets the template that represents command bar which is placed in the bottom edge of the content area.

public Brush ContentBackground { get; set; }

Gets or sets the brush to apply to the background of the window's content.

public Brush ContentBorderBrush { get; set; }

Gets or sets the brush to apply to the border of the window's content.

public Thickness ContentBorderThickness { get; set; }

Gets or sets the border thickness of the window's content element.

public Thickness ContentMargin { get; set; }

Gets or sets the margin of the window's content element.

public ControlBoxPosition ControlBoxPosition { get; set; }

Gets or sets a value that indicates the position of the window's control box.

public Visibility ControlBoxVisibility { get; set; }

Specifies whether the control box UI of the window is visible or hidden.

public ApplicationPackage CurrentApplication { get; }

Gets the current application source associated to this window.

public object DefaultFocus { get; set; }

Specifies the default UI control to be focused when the window is shown.

public Effect DropShadow { get; set; }

Gets or sets the drop shadow effect applied to an active window.

public bool EnableAnimation { get; set; }

Gets or sets a value indicating whether the window animation should be used when processing certain window operations such as minimize, close, etc.

public bool EnableSystemContextMenu { get; set; }

Gets or sets a value indicating whether the built-in window context menu is enabled.

public string GroupName { get; set; }

Specifies the group name of this window.

public Brush HeaderBackground { get; set; }

Gets or sets the brush that applies to the background of the window's header.

public ContentType HeaderDisplayMode { get; set; }

Specifies the display mode of the content presentation.

public Effect HeaderEffect { get; set; }

Gets or sets the effect to apply to the header element.

public Brush HeaderForeground { get; set; }

Represents the brush that applies to the text color of the header element.

public HorizontalAlignment HeaderHorizontalAlignment { get; set; }

Gets or sets the horizontal alignment of the control's header content.

public Thickness HeaderMargin { get; set; }

Gets or sets the margin of the window's header.

public VerticalAlignment HeaderVerticalAlignment { get; set; }

Gets or sets the vertical alignment of the window's header element.

public ImageSource Icon { get; set; }

Gets or sets an image source representing the icon of the window. The recommended image size for Icon is 16x16.

public ImageSource IconLarge { get; set; }

Gets or sets the large version of the window's icon which commonly used in task bar or other UI that requires large icon display. The recommended image size for IconLarge is 48x48.

public Stretch IconStretch { get; set; }

Gets or sets a value that determines the stretching characteristic of the Icon image.

public Brush InactiveBackground { get; set; }

Gets or sets the brush to apply to the background element of an inactive window.

public Brush InactiveBorderBrush { get; set; }

Gets or sets the brush to apply to the border element of an inactive window.

public Effect InactiveDropShadow { get; set; }

Gets or sets the drop shadow effect applied to an inactive window.

public Brush InnerBackground { get; set; }

Gets or sets the brush to apply to the background of the window's inner border.

public Brush InnerBorderBrush { get; set; }

Gets or sets the brush to apply to the border of the window's inner border.

public Thickness InnerBorderThickness { get; set; }

Gets or sets the value that indicates the thickness of the window's inner border.

public CornerRadius InnerCornerRadius { get; set; }

Inner corner radius.

public bool IsActive { get; set; }

Gets or sets the active state of the window.

Remarks

In desktop-integrated mode, only one window can be active at a time. When a window is set as active, the desktop manager automatically deactivates the previously active window. When a window is set to active, its visual state will be changed to Active state. The related events such as Deactivated and Activated will be raised consecutively.

 

public bool IsBusy { get; set; }

Gets or sets the busy state of the window.

Remarks

The UXWindow control provides built-in busy state management allowing you to create compelling window interface that responsive to user interactions. To set a window as busy, you simply set the IsBusy property to true. In addition, ClientUI also provides similar features for other frameworks such as navigation. To learn more about navigation framework, see Navigation Overview.

 

public bool IsClientVisible { get; set; }

Specifies whether this window is visible at runtime.

Remarks

By default, a UXWindow is not automatically shown eventhough it is defined in the UXDesktop control, or when used independently. To show a window, you set its IsClientVisible property to true. To hide a window using property, you set the IsClientVisible property to false. If you use MVVM pattern development, you can bind this property to control the window's visibility in your ViewModel. For more information about MVVM pattern, see MVVM Pattern Overview.

 

public bool IsClosed { get; set; }

Determines whether this window has been closed.

public bool IsDragged { get; }

Determines whether this window is being dragged.

public bool IsResizing { get; }

Determines whether this window is being resized.

public double Left { get; set; }

Gets or sets the left position of the window.

public string MaximizeText { get; set; }

Specifies the tooltip text for the maximize button.

public string MinimizeText { get; set; }

Specifies the tooltip text for the minimize button.

public UIElement Owner { get; set; }

Gets the control that owns this window.

public UIElement ParentControl { get; set; }

Gets the visual parent control of this window.

public DataTemplate PrimaryToolBarTemplate { get; set; }

Gets or sets the template that represents toolbar elements which is placed in the window's primary toolbar area.

public ResizeDirection ResizeDirection { get; set; }

Get or sets a value that controls the direction in which a window can be resized.

public Visibility ResizeGripVisibility { get; set; }

Gets or sets a value indicating whether the window's resize visual hint is visible.

public Visibility ResizeGripVisibilityResolved { get; set; }

The calculated value of ResizeGripVisibility used for XAML binding.

public ResizeHandleMode ResizeMode { get; }

Gets the current resizing mode.

public string RestoreDownText { get; set; }

Specifies the tooltip text for the restore button.

public Grid RootElement { get; }

Gets the root element.

public int RuntimeZIndex { get; set; }

Gets or sets the z-index order of the window.

public DataTemplate SecondaryToolBarTemplate { get; set; }

Gets or sets the template that represents toolbar elements which is placed in the window's secondary toolbar area.

public bool ShowInTaskbar { get; set; }

Gets or sets a value that indicates whether the window has a task bar button when opened.

public object StartupParameters { get; }

Gets the custom data or parameters that transferred by caller during startup process.

public WindowFeatures SupportedFeatures { get; set; }

Represents the windowing features supported by this control.

public UXContextMenu SystemContextMenuStyle { get; set; }

Gets or sets the style to apply to the system context menu.

public Image SystemIconElement { get; }

Gets the system icon element of the window.

public Panel TitleBar { get; }

Gets the title bar element of the window.

public double Top { get; set; }

Gets or sets the top position of the window.

public bool Topmost { get; set; }

Gets or sets a value that indicates whether the window appears in the topmost z-order.

public Style WindowButtonStyle { get; set; }

Gets or sets the style to apply to the window's option buttons.

public UXContextMenu WindowContextMenu { get; }

Gets the window context menu.

public Guid WindowID { get; set; }

Specifies the unique identifier (UID) for this window. This property is not intended to be set directly by developers.

public string WindowName { get; set; }

Gets or sets the name that identifies this window when integrated with desktop and task bar.

public StartupLocation WindowStartupLocation { get; set; }

Gets or sets a value that indicates how the window should be positioned during startup.

public WindowState WindowState { get; set; }

Gets or sets the initial state when the window is first displayed.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

protected Image SystemIconElement { set; }

Gets the system icon element of the window.

protected Panel TitleBar { set; }

Gets the title bar element of the window.

protected UXContextMenu WindowContextMenu { set; }

Gets the window context menu.

Fields

public static readonly DependencyProperty AttachedWindowProperty

Gets or sets the value that represents an IWindow object to be attached.

public static readonly DependencyProperty BlockUIOnBusyProperty

Identifies the BlockUIOnBusy dependency property.

public static readonly DependencyProperty BusyIndicatorTemplateProperty

Identifies the BusyIndicator dependency property.

public static readonly DependencyProperty BusyTextProperty

Identifies the BusyText dependency property.

public static readonly DependencyProperty CanCloseProperty

Identifies the CanClose dependency property.

public static readonly DependencyProperty CanMaximizeProperty

Identifies the CanMaximize dependency property.

public static readonly DependencyProperty CanMinimizeProperty

Identifies the CanMinimize dependency property.

public static readonly DependencyProperty CanMoveProperty

Identifies the HeaderDisplayMode dependency property.

public static readonly DependencyProperty CanResizeProperty

Identifies the CanResize dependency property.

public static readonly DependencyProperty CloseTextProperty

Identifies the CloseText dependency property.

public static readonly DependencyProperty CommandBarTemplateProperty

Identifies the CommandBarTemplate dependency property.

public static readonly DependencyProperty ContentBackgroundProperty

Identifies the ContentBackground dependency property.

public static readonly DependencyProperty ContentBorderBrushProperty

Identifies the ContentBorderBrush dependency property.

public static readonly DependencyProperty ContentBorderThicknessProperty

Identifies the ContentBorderThickness dependency property.

public static readonly DependencyProperty ContentMarginProperty

Identifies the ContentMargin dependency property.

public static readonly DependencyProperty ControlBoxPositionProperty

Identifies the ControlBoxPosition dependency property.

public static readonly DependencyProperty ControlBoxVisibilityProperty

Identifies the ControlBoxVisibility dependency property.

public static readonly DependencyProperty DefaultFocusProperty

Identifies the DefaultFocus dependency property.

public static readonly DependencyProperty DropShadowProperty

Identifies the DropShadow dependency property.

public static readonly DependencyProperty EnableAnimationProperty

Identifies the EnableAnimation dependency property.

public static readonly DependencyProperty EnableSystemContextMenuProperty

Identifies the EnableSystemContextMenu dependency property.

public static readonly DependencyProperty HeaderBackgroundProperty

Identifies the HeaderForeground dependency property.

public static readonly DependencyProperty HeaderDisplayModeProperty

Identifies the HeaderDisplayMode dependency property.

public static readonly DependencyProperty HeaderEffectProperty

Identifies the HeaderEffect dependency property.

public static readonly DependencyProperty HeaderForegroundProperty

Identifies the HeaderForeground dependency property.

public static readonly DependencyProperty HeaderHorizontalAlignmentProperty

Identifies the HeaderHorizontalAlignment dependency property.

public static readonly DependencyProperty HeaderMarginProperty

Identifies the HeaderMargin dependency property.

public static readonly DependencyProperty HeaderVerticalAlignmentProperty

Identifies the HeaderVerticalAlignment dependency property.

public static readonly DependencyProperty IconLargeProperty

Identifies the IconLarge dependency property.

public static readonly DependencyProperty IconProperty

Identifies the Icon dependency property.

public static readonly DependencyProperty IconStretchProperty

Identifies the IconStretch dependency property.

public static readonly DependencyProperty InactiveBackgroundProperty

Identifies the InactiveBackground dependency property.

public static readonly DependencyProperty InactiveBorderBrushProperty

Identifies the InactiveBorderBrush dependency property.

public static readonly DependencyProperty InactiveDropShadowProperty

Identifies the InactiveDropShadow dependency property.

public static readonly DependencyProperty InnerBackgroundProperty

Identifies the InnerBackground dependency property.

public static readonly DependencyProperty InnerBorderBrushProperty

Identifies the InnerBorderBrush dependency property.

public static readonly DependencyProperty InnerBorderThicknessProperty

Identifies the InnerBorderThickness dependency property.

public static readonly DependencyProperty InnerCornerRadiusProperty

Identifies the InnerCornerRadius dependency property.

public static readonly DependencyProperty IsActiveProperty

Identifies the IsActive dependency property.

public static readonly DependencyProperty IsBusyProperty

Identifies the IsBusy dependency property.

public static readonly DependencyProperty IsClientVisibleProperty

Identifies the IsClientVisible dependency property.

public static readonly DependencyProperty LeftProperty

Identifies the Left dependency property.

public static readonly DependencyProperty MaximizeTextProperty

Identifies the MaximizeText dependency property.

public static readonly DependencyProperty MinimizeTextProperty

Identifies the MinimizeText dependency property.

public static readonly DependencyProperty PrimaryToolBarTemplateProperty

Identifies the PrimaryToolBarTemplate dependency property.

public static readonly DependencyProperty ResizeDirectionProperty

Identifies the ResizeDirection dependency property.

public static readonly DependencyProperty ResizeGripVisibilityProperty

Identifies the ResizeGripVisibility dependency property.

public static readonly DependencyProperty ResizeGripVisibilityResolvedProperty

Identifies the ResizeGripVisibilityResolved dependency property.

public static readonly DependencyProperty RestoreDownTextProperty

Identifies the RestoreDownText dependency property.

public static readonly DependencyProperty RuntimeZIndexProperty

Identifies the RuntimeZIndex dependency property.

public static readonly DependencyProperty SecondaryToolBarTemplateProperty

Identifies the SecondaryToolBarTemplate dependency property.

public static readonly DependencyProperty ShowInTaskbarProperty

Identifies the ShowInTaskbar dependency property.

public static readonly DependencyProperty StartupParametersProperty

Identifies the StartupParameters dependency property.

public static readonly DependencyProperty SystemContextMenuStyleProperty

Identifies the SystemContextMenu dependency property.

public static readonly DependencyProperty TopmostProperty

Identifies the Topmost dependency property.

public static readonly DependencyProperty TopProperty

Identifies the Top dependency property.

public static readonly DependencyProperty WindowButtonStyleProperty

Identifies the WindowButtonStyle dependency property.

public static readonly DependencyProperty WindowNameProperty

Identifies the WindowName dependency property.

public static readonly DependencyProperty WindowStartupLocationProperty

Identifies the WindowStartupLocation dependency property.

public static readonly DependencyProperty WindowStateProperty

Identifies the WindowState dependency property.

Static Methods

public static IWindow GetAttachedWindow(DependencyObject obj)

Gets the value of the AttachedWindow property of the specified object.

Parameters

objObject to query concerning the AttachedWindow property.

Return Types

Value of the AttachedWindow property.

 

public static IWindow GetWindowHost(UIElement element)

Returns a reference to the IWindow object that hosts the content tree within which the UIElement is located.

Parameters

elementThe UIElement.

Return Types

A IWindow object.

 

public static void SetAttachedWindow(DependencyObject obj, IWindow value)

Sets the value of the AttachedWindow property of the specified object.

Parameters

objObject to set the property on.
valueValue to set.

 

Public Methods

public void BringToFront()

Brings the window to the front of the z-order.

public void Close()

Permanently close the window and releases all the resources allocated by the window.

public void DetachedEventHandlers()

Detach built-in event handlers from control templates. Call this method if necessary.

public void Dispose()

Called when the object is disposed.

public WindowStateData GetCurrentWindowState()

Gets the data that represents the current window state.

Return Types

A WindowStateData object.

 

public UXDesktop GetDesktop()

Returns the UXDesktop instance that hosts this window.

public DependencyObject GetElement(string partName)

Gets the element of the specified part name.

Parameters

partNameThe name of which element to be retrieved.

Return Types

Returns a DependencyObject.

 

public FrameworkElement GetImplementationRoot()

Gets the implementation root of this control.

Return Types

A FrameworkElement which is the implementation root of the control.

 

public ImageSource GetThumbnail(bool forceRefresh)

Returns an ImageSource that represents the thumbnail of the current window's visual.

Parameters

forceRefreshWhether the thumbnail is forced to refresh.

Return Types

The ImageSource of the thumbnail representing the current window's visual.

 

public void Hide()

Hides the window.

public bool IsFeatureSupported(object feature)

Determines whether a feature is supported by this window class.

Parameters

featureThe feature to be queried, i.e, one of the values defined in WindowFeatures enumeration.

Return Types

True if the feature is supported.

 

public void Maximize()

Maximizes the window to the available screen real estate.

public void Minimize()

Minimizes the window to the task bar. This method will take affect only when the TaskBar property of the window is assigned.

public void MoveTo(double x, double y)

Moves the window to the specified location.

Parameters

xThe horizontal position of the window.
yThe vertical position of the window.

 

public void OnApplyTemplate()

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

public void ResizeTo(double width, double height)

Resizes the window to the specified dimension.

Parameters

widthThe new width dimension of the window.
heightThe new height dimension of the window.

 

public void Restore()

Restores the window from minimized or maximized state.

public void SendToBack()

Sends the window to the back of the z-order.

public void Show()

Displays the window.

public void Show(FrameworkElement owner)

Displays the window and attach it to a specified owner.

Parameters

ownerThe owner of the window.

 

public void UpdateVisualThumbnail()

Updates the thumbnail of the current window's visual.

Protected Methods

protected void OnActivated()

Called when the window is activated.

protected void OnCanResizeChanged()

Called when the CanResize property is changed.

protected bool OnClosedCore()

Called when the window is closed and ready to be destroyed.

Return Types

If return value is true, the default implementation will be executed.

 

protected void OnCornerRadiusChanged()

Called when the value of CornerRadius property changes.

protected void OnDataTemplateChanged(DependencyProperty dp)

Called when one of the data template properties defined in UXWindow is changed.

Parameters

dpA DependencyProperty representing the changed data template.

 

protected void OnDeactivated()

Called when the window is deactivated.

protected void OnGotFocus(RoutedEventArgs e)

Called before the GotFocus event occurs.

Parameters

eThe data for the event.

 

protected void OnIsActiveChanged(bool oldValue, bool newValue)

Called when the value of IsActive property is changed.

Parameters

oldValueThe old value of the IsActive property.
newValueThe new value of the IsActive property.

 

protected void OnIsBusyChanged()

Called when the value of IsBusy property is changed.

protected void OnIsClientVisibleChanged()

Called when the value of IsClientVisible property has changed.

protected void OnLocationChange(DependencyPropertyChangedEventArgs args)

Called when the window location is about to change.

Parameters

argsA DependencyPropertyChangedEventArgs containing the old and new value of the location.

 

protected void OnLocationChanged(double newX, double newY)

Called when the window location is changed.

Parameters

newXThe X-coordinate of the new window location.
newYThe Y-coordinate of the new window location.

 

protected void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Overridden.

Parameters

eThe mouse event argument.

 

protected void OnRuntimeZIndexChanged(int newZIndex)

Called when the value of RuntimeZIndex property is changed.

Parameters

newZIndexThe new z-index order to apply.

 

protected void OnTopmostChanged()

Called when the value of Topmost property is changed.

protected void OnWindowStateChanged(WindowState fromState, WindowState toState)

Called when the window state is changed.

Parameters

fromStateThe previous window state.
toStateThe new window state.

 

Events

public event WindowEventHandler Activated

Occurs when a window becomes the foreground window.

public event WindowEventHandler BusyChanged

Occurs when the busy state of the window is changed.

public event WindowEventHandler Closed

Occurs when a window is closed.

public event WindowEventHandler Closing

Occurs when a window is about to close.

public event WindowEventHandler Created

Occurs when a window is created and all required window resources are loaded.

public event WindowEventHandler Deactivated

Occurs when a window becomes a background window.

public event WindowEventHandler Destroyed

Occurs when a window is permanently closed and destroyed.

public event KeyboardFocusChangedEventHandler GotKeyboardFocus

Occurs when the window or a control in the window receives focus from keyboard device.

public event KeyboardFocusChangedEventHandler LostKeyboardFocus

Occurs when the window or a control in the window loses its keyboard focus.

public event WindowEventHandler Moved

Occurs when a window is moved.

public event WindowEventHandler Opened

Occurs when a window is opened for the first time.

public event WindowEventHandler Opening

Occurs when a window is about to open for the first time.

public event WindowActivationEventHandler Reactivated

Occurs when a window is reactivated from an external ApplicationLaunch command or API.

public event WindowEventHandler Resized

Occurs when a window is resized.

public event WindowContextMenuEventHandler SystemContextMenu

Occurs when the context menu is requested.

public event WindowOperationEventHandler WindowStateChanged

Occurs when the state of the window is changed.

public event WindowOperationEventHandler WindowStateChanging

Occurs when the state of the window is about to change.

  • No labels