Show / Hide Table of Contents

Class Window

Represents an application window.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Window
Inherited Members
FrameworkElement.LayoutUpdated
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.OnApplyTemplate()
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.ManageIsEnabled(Boolean)
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public class Window : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

Window()

Initializes a new instance of the Window class.

Declaration
public Window()

Fields

| Improve this Doc View Source

ContentProperty

Identifies the Content dependency property.

Declaration
public static readonly DependencyProperty ContentProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

Bounds

Gets the height and width of the application window, as a Rect value.

Declaration
public Rect Bounds { get; }
Property Value
Type Description
Rect
| Improve this Doc View Source

Content

Gets or sets the content of the Window.

Declaration
public FrameworkElement Content { get; set; }
Property Value
Type Description
FrameworkElement
| Improve this Doc View Source

Current

Gets the currently activated window for an application.

Declaration
public static Window Current { get; set; }
Property Value
Type Description
Window
| Improve this Doc View Source

IsActive

Declaration
[NotImplemented]
public bool IsActive { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsVisible

Declaration
[NotImplemented]
public bool IsVisible { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Left

Gets or sets the position of the left edge of the application window; see Remarks for restrictions on setting this property at run time.

Declaration
[NotImplemented]
public double Left { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Title

Gets or sets the window title bar text.

Declaration
[NotImplemented]
public string Title { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Top

Gets or sets the position of the top edge of the application window; see Remarks for restrictions on setting this property at run time.

Declaration
[NotImplemented]
public double Top { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

VisualChildrenCount

Declaration
protected override int VisualChildrenCount { get; }
Property Value
Type Description
System.Int32
Overrides
FrameworkElement.VisualChildrenCount
| Improve this Doc View Source

WindowState

Declaration
[NotImplemented]
public WindowState WindowState { get; set; }
Property Value
Type Description
WindowState
| Improve this Doc View Source

WindowStyle

Declaration
[NotImplemented]
public WindowStyle WindowStyle { get; set; }
Property Value
Type Description
WindowStyle

Methods

| Improve this Doc View Source

Activate()

Attempts to activate the application window by bringing it to the foreground and setting the input focus to it.

Declaration
public void Activate()
| Improve this Doc View Source

ArrangeOverride(Size)

Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type Name Description
Size finalSize
Returns
Type Description
Size
Overrides
FrameworkElement.ArrangeOverride(Size)
| Improve this Doc View Source

AttachToDomElement(INTERNAL_HtmlDomElementReference)

Set the DOM element that will host the window. This can be set only to new windows. The MainWindow looks for a DIV that has the ID "cshtml5-root" or "opensilver-root".

Declaration
public void AttachToDomElement(INTERNAL_HtmlDomElementReference rootDomElement)
Parameters
Type Name Description
CSHTML5.Internal.INTERNAL_HtmlDomElementReference rootDomElement

The DOM element that will host the window

| Improve this Doc View Source

Close()

Declaration
[NotImplemented]
public void Close()
| Improve this Doc View Source

CreateDomElement(Object, out Object)

Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type Name Description
System.Object parentRef
System.Object domElementWhereToPlaceChildren
Returns
Type Description
System.Object
Overrides
FrameworkElement.CreateDomElement(Object, out Object)
| Improve this Doc View Source

DragMove()

Declaration
[NotImplemented]
public void DragMove()
| Improve this Doc View Source

DragResize(WindowResizeEdge)

Declaration
[NotImplemented]
public void DragResize(WindowResizeEdge resizeEdge)
Parameters
Type Name Description
WindowResizeEdge resizeEdge
| Improve this Doc View Source

GetVisualChild(Int32)

Declaration
protected override UIElement GetVisualChild(int index)
Parameters
Type Name Description
System.Int32 index
Returns
Type Description
UIElement
Overrides
FrameworkElement.GetVisualChild(Int32)
| Improve this Doc View Source

GetWindow(DependencyObject)

Gets the window that contains the specified DependencyObject.

Declaration
public static Window GetWindow(DependencyObject dependencyObject)
Parameters
Type Name Description
DependencyObject dependencyObject

The object contained by the Window to get.

Returns
Type Description
Window

The Window to get.

Exceptions
Type Condition
System.InvalidOperationException

dependencyObject is not a valid DependencyObject.

| Improve this Doc View Source

MeasureOverride(Size)

Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type Name Description
Size availableSize
Returns
Type Description
Size
Overrides
FrameworkElement.MeasureOverride(Size)
| Improve this Doc View Source

OnClosing(ClosingEventArgs)

Raises the Closing event

Declaration
protected void OnClosing(ClosingEventArgs eventArgs)
Parameters
Type Name Description
ClosingEventArgs eventArgs

The arguments for the event.

| Improve this Doc View Source

OnContentChanged(Object, Object)

Declaration
protected void OnContentChanged(object oldContent, object newContent)
Parameters
Type Name Description
System.Object oldContent
System.Object newContent
| Improve this Doc View Source

Show()

Show the window

Declaration
[NotImplemented]
public void Show()

Events

| Improve this Doc View Source

Closing

Occurs when the window is about to close.

Declaration
public event EventHandler<ClosingEventArgs> Closing
Event Type
Type Description
System.EventHandler<ClosingEventArgs>
| Improve this Doc View Source

SizeChanged

Occurs when the window has rendered or changed its rendering size.

Declaration
public event WindowSizeChangedEventHandler SizeChanged
Event Type
Type Description
WindowSizeChangedEventHandler

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source