WindowBase
Base class for creating a custom Window.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Navigation.dll
Syntax:
public abstract class WindowBase : HeaderedContentControl, INotifyLayoutChange, IDragAware
Inheritance: objectWindowBase
Derived Classes:
Implements:
Constructors
Initializes a new instance of the WindowBase class.
protected WindowBase()
Fields
CanCloseProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty CanCloseProperty
CanMoveProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty CanMoveProperty
CaptionHeightProperty
DependencyProperty
Identifies the CaptionHeight dependency property.
public static readonly DependencyProperty CaptionHeightProperty
CornerRadiusProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty CornerRadiusProperty
HideMaximizeButtonProperty
DependencyProperty
Identifies the HideMaximizeButton dependency property.
public static readonly DependencyProperty HideMaximizeButtonProperty
HideMinimizeButtonProperty
DependencyProperty
Identifies the HideMinimizeButton dependency property.
public static readonly DependencyProperty HideMinimizeButtonProperty
IsActiveWindowProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsActiveWindowProperty
IsDraggingProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsDraggingProperty
IsInActiveStateProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsInActiveStateProperty
IsModalProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsModalProperty
IsOpenProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsOpenProperty
IsResizingProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty IsResizingProperty
IsTopmostProperty
DependencyProperty
Identifies the IsTopmost dependency property.
public static readonly DependencyProperty IsTopmostProperty
LeftProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty LeftProperty
ResizeBorderProperty
DependencyProperty
Identifies the ResizeBorder dependency property.
public static readonly DependencyProperty ResizeBorderProperty
ResizeModeProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty ResizeModeProperty
SizeToContentProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty SizeToContentProperty
TopProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty TopProperty
WindowStateProperty
DependencyProperty
Identifies the
public static readonly DependencyProperty WindowStateProperty
Properties
Gets or sets whether WindowBase can be closed. This is a dependency property.
public bool CanClose { get; set; }
True if this instance can be closed; false otherwise.
If the value of this property is true, the instance
cannot be closed and the Close button is hidden; otherwise it can be closed.
Gets or sets whether WindowBase can be dragged. This is a dependency property.
public bool CanMove { get; set; }
True if this instance can be dragged; otherwise, false.
If the value of this property is true, the instance
can be dragged; otherwise it is is fixed.
The extent of the top of the window to treat as the caption.
public double CaptionHeight { get; set; }
CornerRadius
CornerRadius
Gets or sets the CornerRadius property.
public CornerRadius CornerRadius { get; set; }
Gets or sets the visibility of the Maximize button.
public bool HideMaximizeButton { get; set; }
Gets or sets the visibility of the Minimize button.
public bool HideMinimizeButton { get; set; }
Gets a value indicating whether this instance is active. This is a dependency property.
public bool IsActiveWindow { get; }
True if this instance is active; otherwise, false.
Gets a value indicating whether this instance is dragging. This is a dependency property.
public bool IsDragging { get; protected set; }
True if this instance is is dragging; otherwise, false.
Gets a value indicating whether this instance should appear active. It is not necessary equal to IsActiveWindow. This is a read only dependency property.
public bool IsInActiveState { get; }
Gets a value indicating whether this instance is layout changing.
public bool IsLayoutChanging { get; }
True if this instance is layout changing; otherwise, false.
Implements:
Gets a value that represents whether the WindowBase is modal. This is a dependency property.
public bool IsModal { get; }
Gets a value that represents whether the WindowBase is open. This is a dependency property.
public bool IsOpen { get; protected set; }
Gets a value indicating whether this instance is resizing. This is a dependency property.
public bool IsResizing { get; protected set; }
True if this instance is resizing;false otherwise.
Gets or sets whether the WindowBase is on top.
public bool IsTopmost { get; set; }
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.
public double Left { get; set; }
Owner
ContentControl
Gets or sets the Owner of the WindowBase.
public ContentControl Owner { get; set; }
ResizeBorder
Thickness
Get the bounds of the resize grips on the Window.
public Thickness ResizeBorder { get; set; }
ResizeMode
ResizeMode
Gets or sets a ResizeMode value for the WindowBase. This is a dependency property.
public ResizeMode ResizeMode { get; set; }
The value of this property is ignored if the Width and Height properties are set.
public bool SizeToContent { get; set; }
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.
public double Top { get; set; }
WindowState
WindowState
Gets or sets a WindowBase value for the WindowBase. This is a dependency property.
public WindowState WindowState { get; set; }
Methods
Attempts to bring the WindowBase over any other WindowBases except topmost.
public void BringToFront()
Whenever opened WindowBase automatically appears over any other windows except topmost.
Updates the visual state of the control.
protected void ChangeVisualState()
Updates the visual state of the control.
protected virtual void ChangeVisualState(bool useTransitions)
Indicates whether transitions should be used.
Checks whether the window can be closed. This method doesn't consider the CanClose property, but checked for some other kind of constraints.
protected virtual bool CheckCanClose()
True if the window can be changed; false otherwise.
Manually closes WindowBase.
public void Close()
Raises
Closes the Window instantly and the closing cannot be interrupted.
protected void CloseWithoutEventsAndAnimations()
Gets the application size depending on the platform.
protected Size GetApplicationSize()
Size
Gets the size and position of the WindowBase in its normal state.
public Rect GetNormalSizeAndPosition()
Rect
A rectangle with the Left, Top, Width and Height properties of the WindowBase in normal state.
GetWindowOwner()
ContentControl
Gets the owner of the WindowBase.
protected virtual ContentControl GetWindowOwner()
ContentControl
Gets the owner handle of the WindowBase.
GetWindowStartupLocation()
WindowStartupLocation
Gets the startup location of the WindowBase.
protected virtual WindowStartupLocation GetWindowStartupLocation()
WindowStartupLocation
Gets the z-index of the window, which determines the order in which windows are rendered on the screen.
Closes the host immediately without any animations and events.
protected virtual void OnCloseAnimationFinished()
Closes the host immediately without any animations and events.
protected virtual void OnClosed()
Checks whether the window can be closed and raises the Closing event.
OnCreateAutomationPeer()
AutomationPeer
Create the automation peer for this class.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Handles the delta of the drag operation.
protected virtual Rect OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, bool isResize)
Rect
Handles the start of the drag operation.
protected virtual void OnDragStart(Point globalMousePosition, bool isResize)
Invoked when an unhandled System.Windows.Input.Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.
Raises the event.
protected virtual void OnHostCreated(HostWindowCreatedEventArgs args)
The HostWindowCreatedEventArgs instance containing the event data.
Ends the layout changing scope and raises the event.
protected void OnLayoutChangeEnded()
Begins the layout changing scope and raises the event if it is not already active.
protected void OnLayoutChangeStarted()
Raises the event.
protected virtual void OnLocationChanged(EventArgs args)
The RoutedEventArgs instance containing the event data.
Closes the host immediately without any animations and events.
protected virtual void OnRightMouseButtonUp()
Updates the position helper and checks the restricted area and updates the rect of the window.
protected virtual void OnRootVisualSizeChanged()
Closes the host immediately without any animations and events.
protected virtual void OnShowAnimationFinished()
Raises the event.
protected virtual void OnWindowStateChanged(EventArgs args)
The RoutedEventArgs instance containing the event data.
Indicates whether the Window should be activated when the focus goes to it.
Indicates whether the Window should be activated when it is shown.
Indicates whether the Window should focus when it is activated.
Indicates whether the Window should be present in the Task Switcher (Alt+Tab) menu of the Windows. In order to hide it correctly, the Window shouldn't be shown in the taskbar (ShowInTaskbar property should be false).
When overridden in the derived class this methods returns value that determines whether the system menu should be shown when the user right-clicks the header of the WindowBase control.
Shows the window either modally or not. This method should be used in the subclasses to open the window.
protected virtual void ShowWindow(bool isModal)
Whether the window is modal or not.
Events
Occurs when the Window is activated.
public event EventHandler Activated
Occurs when the Window is deactivated.
public event EventHandler Deactivated
Occurs when a layout change is ended.
public event EventHandler LayoutChangeEnded
Implements:
Occurs when a layout change is started.
public event EventHandler LayoutChangeStarted
Implements:
Occurs when the value of a Left or Top changes.
[SRCategory("Behavior")]
public event EventHandler LocationChanged
Occurs when the value of a WindowState changes.
[SRCategory("Behavior")]
public event EventHandler WindowStateChanged
The event is raised whenever the