Class
WindowBase

Definition

Namespace:Telerik.UI.Xaml.Controls

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public abstract class WindowBase : HeaderedContentControl, INotifyLayoutChange, IDragAware

Inheritance: objectHeaderedContentControlWindowBase

Derived Classes: RadWindow

Implements: IDragAwareINotifyLayoutChange

Inherited Members HeaderedContentControl.HasHeaderPropertyHeaderedContentControl.HeaderPropertyHeaderedContentControl.HeaderTemplatePropertyHeaderedContentControl.FocusVisualStylePropertyHeaderedContentControl.HeaderTemplateSelectorPropertyHeaderedContentControl.IsFocusedPropertyHeaderedContentControl.OnApplyTemplate()HeaderedContentControl.ChangeVisualState()HeaderedContentControl.OnIsEnabledChanged(DependencyPropertyChangedEventArgs)HeaderedContentControl.OnHeaderChanged(object, object)HeaderedContentControl.OnHeaderTemplateChanged(DataTemplate, DataTemplate)HeaderedContentControl.OnIsFocusedChanged(DependencyPropertyChangedEventArgs)HeaderedContentControl.OnLostFocus(RoutedEventArgs)HeaderedContentControl.HasHeaderHeaderedContentControl.IsFocusedHeaderedContentControl.HeaderHeaderedContentControl.FocusVisualStyleHeaderedContentControl.HeaderTemplateHeaderedContentControl.HeaderTemplateSelector

Constructors

WindowBase()

Initializes a new instance of the WindowBase class.

Declaration

cs-api-definition
protected WindowBase()

Fields

CanCloseProperty

Identifies the CanClose Property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanCloseProperty

Field Value

DependencyProperty

CanMoveProperty

Identifies the CanMove Property.

Declaration

cs-api-definition
public static readonly DependencyProperty CanMoveProperty

Field Value

DependencyProperty

CaptionHeightProperty

Identifies the CaptionHeight dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty CaptionHeightProperty

Field Value

DependencyProperty

HideMaximizeButtonProperty

Identifies the HideMaximizeButton dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HideMaximizeButtonProperty

Field Value

DependencyProperty

HideMinimizeButtonProperty

Identifies the HideMinimizeButton dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty HideMinimizeButtonProperty

Field Value

DependencyProperty

IsActiveWindowProperty

Identifies the IsActiveWindow Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsActiveWindowProperty

Field Value

DependencyProperty

IsDraggingProperty

Identifies the IsDragging Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsDraggingProperty

Field Value

DependencyProperty

IsModalProperty

Identifies the IsModal Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsModalProperty

Field Value

DependencyProperty

IsOpenProperty

Identifies the IsOpen Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsOpenProperty

Field Value

DependencyProperty

IsResizingProperty

Identifies the IsResizing Property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsResizingProperty

Field Value

DependencyProperty

IsTopmostProperty

Identifies the IsTopmost dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsTopmostProperty

Field Value

DependencyProperty

LeftProperty

Identifies the Left dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty LeftProperty

Field Value

DependencyProperty

ResizeBorderProperty

Identifies the ResizeBorder dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ResizeBorderProperty

Field Value

DependencyProperty

ResizeModeProperty

Identifies the ResizeMode dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty ResizeModeProperty

Field Value

DependencyProperty

SizeToContentProperty

Identifies the SizeToContent dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty SizeToContentProperty

Field Value

DependencyProperty

TopProperty

Identifies the Top dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty TopProperty

Field Value

DependencyProperty

WindowStateProperty

Identifies the WindowState dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty WindowStateProperty

Field Value

DependencyProperty

Properties

CanClose

Gets or sets whether WindowBase can be closed. This is a dependency property.

Declaration

cs-api-definition
public bool CanClose { get; set; }

Property Value

bool

True if this instance can be closed; false otherwise.

Remarks

If the value of this property is true, the instance cannot be closed and the Close button is hidden; otherwise it can be closed.

CanMove

Gets or sets whether WindowBase can be dragged. This is a dependency property.

Declaration

cs-api-definition
public bool CanMove { get; set; }

Property Value

bool

True if this instance can be dragged; otherwise, false.

Remarks

If the value of this property is true, the instance can be dragged; otherwise it is is fixed.

CaptionHeight

The extent of the top of the window to treat as the caption.

Declaration

cs-api-definition
public double CaptionHeight { get; set; }

Property Value

double

HideMaximizeButton

Gets or sets the visibility of the Maximize button.

Declaration

cs-api-definition
public bool HideMaximizeButton { get; set; }

Property Value

bool

HideMinimizeButton

Gets or sets the visibility of the Minimize button.

Declaration

cs-api-definition
public bool HideMinimizeButton { get; set; }

Property Value

bool

IsActiveWindow

Gets a value indicating whether this instance is active. This is a dependency property.

Declaration

cs-api-definition
public bool IsActiveWindow { get; }

Property Value

bool

True if this instance is active; otherwise, false.

IsDragging

Gets a value indicating whether this instance is dragging. This is a dependency property.

Declaration

cs-api-definition
public bool IsDragging { get; protected set; }

Property Value

bool

True if this instance is is dragging; otherwise, false.

IsLayoutChanging

Gets a value indicating whether this instance is layout changing.

Declaration

cs-api-definition
public bool IsLayoutChanging { get; }

Property Value

bool

True if this instance is layout changing; otherwise, false.

Implements INotifyLayoutChange.IsLayoutChanging

IsModal

Gets a value that represents whether the WindowBase is modal. This is a dependency property.

Declaration

cs-api-definition
public bool IsModal { get; }

Property Value

bool

IsOpen

Gets a value that represents whether the WindowBase is open. This is a dependency property.

Declaration

cs-api-definition
public bool IsOpen { get; protected set; }

Property Value

bool

IsResizing

Gets a value indicating whether this instance is resizing. This is a dependency property.

Declaration

cs-api-definition
public bool IsResizing { get; protected set; }

Property Value

bool

True if this instance is resizing;false otherwise.

IsTopmost

Gets or sets whether the WindowBase is on top.

Declaration

cs-api-definition
public bool IsTopmost { get; set; }

Property Value

bool

Left

Gets or sets a value that represents the distance between the left side of an element and the left side of the page. This is a dependency property.

Declaration

cs-api-definition
public double Left { get; set; }

Property Value

double

Owner

Gets or sets the Owner of the WindowBase.

Declaration

cs-api-definition
public ContentControl Owner { get; set; }

Property Value

ContentControl

ResizeBorder

Get the bounds of the resize grips on the Window.

Declaration

cs-api-definition
public Thickness ResizeBorder { get; set; }

Property Value

Thickness

ResizeMode

Gets or sets a ResizeMode value for the WindowBase. This is a dependency property.

Declaration

cs-api-definition
public ResizeMode ResizeMode { get; set; }

Property Value

ResizeMode

SizeToContent

The value of this property is ignored if the Width and Height properties are set.

Declaration

cs-api-definition
public bool SizeToContent { get; set; }

Property Value

bool

Top

Gets or sets a value that represents the distance between the top of an element and the top of the page. This is a dependency property.

Declaration

cs-api-definition
public double Top { get; set; }

Property Value

double

WindowState

Gets or sets a WindowBase value for the WindowBase. This is a dependency property.

Declaration

cs-api-definition
public WindowState WindowState { get; set; }

Property Value

WindowState

Methods

BringToFront()

Attempts to bring the WindowBase over any other WindowBases except topmost.

Declaration

cs-api-definition
public void BringToFront()

Remarks

Whenever opened WindowBase automatically appears over any other windows except topmost.

ChangeVisualState(bool)

Declaration

cs-api-definition
protected override void ChangeVisualState(bool useTransitions)

Parameters

useTransitions

bool

Overrides HeaderedContentControl.ChangeVisualState(bool)

CheckCanClose()

Checks whether the window can be closed. This method doesn't consider the CanClose property, but checked for some other kind of constraints.

Declaration

cs-api-definition
protected virtual bool CheckCanClose()

Returns

bool

True if the window can be changed; false otherwise.

Close()

Manually closes WindowBase.

Declaration

cs-api-definition
public void Close()

Remarks

Raises Closing and Closed events consequently.

Example

csharp
WindowBase window = new WindowBase();
window.Height = 100;
window.Width = 100;
window.Header = "WindowBase";
window.Content = "This is your content";
window.Show();
window.Close();
csharp
Dim window As WindowBase = New WindowBase
window.Height = 100
window.Width = 100
window.Header = "WindowBase"
window.Content = "This is your content"
window.Show()
window.Close()

CloseWithoutEventsAndAnimations()

Closes the Window instantly and the closing cannot be interrupted.

Declaration

cs-api-definition
protected void CloseWithoutEventsAndAnimations()

GetApplicationSize()

Gets the application size depending on the platform.

Declaration

cs-api-definition
protected Size GetApplicationSize()

Returns

Size

GetNormalSizeAndPosition()

Gets the size and position of the WindowBase in its normal state.

Declaration

cs-api-definition
public Rect GetNormalSizeAndPosition()

Returns

Rect

A rectangle with the Left, Top, Width and Height properties of the WindowBase in normal state.

GetWindowOwner()

Declaration

cs-api-definition
protected virtual ContentControl GetWindowOwner()

Returns

ContentControl

GetWindowStartupLocation()

Declaration

cs-api-definition
protected virtual WindowStartupLocation GetWindowStartupLocation()

Returns

WindowStartupLocation

GetZIndex()

Declaration

cs-api-definition
public virtual int GetZIndex()

Returns

int

OnActivated(EventArgs)

Raises the event. This method is called when the window is activated.

Declaration

cs-api-definition
protected virtual void OnActivated(EventArgs e)

Parameters

e

EventArgs

The EventArgs instance containing the event data.

OnCloseAnimationFinished()

Declaration

cs-api-definition
protected virtual void OnCloseAnimationFinished()

OnClosed()

Declaration

cs-api-definition
protected virtual void OnClosed()

OnClosing()

Declaration

cs-api-definition
protected virtual bool OnClosing()

Returns

bool

OnDeactivated(EventArgs)

Raises the event. This method is called when the window is deactivated.

Declaration

cs-api-definition
protected virtual void OnDeactivated(EventArgs e)

Parameters

e

EventArgs

The EventArgs instance containing the event data.

OnDragDelta(Point, Rect, Rect, bool)

Declaration

cs-api-definition
protected virtual Rect OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, bool isResize)

Parameters

globalMousePosition

Point

initialRect

Rect

destinationRect

Rect

isResize

bool

Returns

Rect

OnDragEnd(Point, bool, bool)

Declaration

cs-api-definition
protected virtual void OnDragEnd(Point globalMousePosition, bool isCancel, bool isResize)

Parameters

globalMousePosition

Point

isCancel

bool

isResize

bool

OnDragStart(Point, bool)

Declaration

cs-api-definition
protected virtual void OnDragStart(Point globalMousePosition, bool isResize)

Parameters

globalMousePosition

Point

isResize

bool

OnGotFocus(RoutedEventArgs)

Called before the System.Windows.UIElement.GotFocus event occurs.

Declaration

cs-api-definition
protected override void OnGotFocus(RoutedEventArgs e)

Parameters

e

RoutedEventArgs

The data for the event.

Overrides HeaderedContentControl.OnGotFocus(RoutedEventArgs)

OnLayoutChangeEnded()

Declaration

cs-api-definition
protected void OnLayoutChangeEnded()

OnLayoutChangeEnded(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnLayoutChangeEnded(EventArgs args)

Parameters

args

EventArgs

The EventArgs instance containing the event data.

OnLayoutChangeStarted()

Declaration

cs-api-definition
protected void OnLayoutChangeStarted()

OnLayoutChangeStarted(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnLayoutChangeStarted(EventArgs args)

Parameters

args

EventArgs

The EventArgs instance containing the event data.

OnLocationChanged(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnLocationChanged(EventArgs args)

Parameters

args

EventArgs

The System.Windows.RoutedEventArgs instance containing the event data.

OnRightMouseButtonUp()

Declaration

cs-api-definition
protected virtual void OnRightMouseButtonUp()

OnRootVisualSizeChanged()

Declaration

cs-api-definition
protected virtual void OnRootVisualSizeChanged()

OnShowAnimationFinished()

Declaration

cs-api-definition
protected virtual void OnShowAnimationFinished()

OnWindowStateChanged(EventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnWindowStateChanged(EventArgs args)

Parameters

args

EventArgs

The System.Windows.RoutedEventArgs instance containing the event data.

ShouldActivateOnShow()

Declaration

cs-api-definition
protected virtual bool ShouldActivateOnShow()

Returns

bool

ShouldFocusOnActivate()

Declaration

cs-api-definition
protected virtual bool ShouldFocusOnActivate()

Returns

bool

ShowWindow(bool)

Shows the window either modally or not. This method should be used in the subclasses to open the window.

Declaration

cs-api-definition
protected virtual void ShowWindow(bool isModal)

Parameters

isModal

bool

Whether the window is modal or not.

Events

Activated

Occurs when the Window is activated.

Declaration

cs-api-definition
public event EventHandler Activated

Event Value

EventHandler

Deactivated

Occurs when the Window is deactivated.

Declaration

cs-api-definition
public event EventHandler Deactivated

Event Value

EventHandler

LayoutChangeEnded

Occurs when a layout change is ended.

Declaration

cs-api-definition
public event EventHandler LayoutChangeEnded

Event Value

EventHandler

Implements INotifyLayoutChange.LayoutChangeEnded

LayoutChangeStarted

Occurs when a layout change is started.

Declaration

cs-api-definition
public event EventHandler LayoutChangeStarted

Event Value

EventHandler

Implements INotifyLayoutChange.LayoutChangeStarted

LocationChanged

Occurs when the value of a Left or Top changes.

Declaration

cs-api-definition
public event EventHandler LocationChanged

Event Value

EventHandler

WindowStateChanged

Occurs when the value of a WindowState changes.

Declaration

cs-api-definition
public event EventHandler WindowStateChanged

Event Value

EventHandler

Remarks

The event is raised whenever the WindowState property is changed.