Class WindowBase
Base class for creating a custom Window.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.Navigation.dll
Syntax
public abstract class WindowBase : HeaderedContentControl, INotifyLayoutChange, IWindowDragAware, IDragAware, IClickAware
Constructors
WindowBase()
Initializes a new instance of the WindowBase class.
Declaration
protected WindowBase()
Fields
CanCloseProperty
Identifies the
Declaration
public static readonly DependencyProperty CanCloseProperty
Field Value
System.
|
CanMoveProperty
Identifies the
Declaration
public static readonly DependencyProperty CanMoveProperty
Field Value
System.
|
CaptionHeightProperty
Identifies the CaptionHeight dependency property.
Declaration
public static readonly DependencyProperty CaptionHeightProperty
Field Value
System.
|
CornerRadiusProperty
Identifies the
Declaration
public static readonly DependencyProperty CornerRadiusProperty
Field Value
System.
|
HideMaximizeButtonProperty
Identifies the HideMaximizeButton dependency property.
Declaration
public static readonly DependencyProperty HideMaximizeButtonProperty
Field Value
System.
|
HideMinimizeButtonProperty
Identifies the HideMinimizeButton dependency property.
Declaration
public static readonly DependencyProperty HideMinimizeButtonProperty
Field Value
System.
|
IsActiveWindowProperty
Identifies the
Declaration
public static readonly DependencyProperty IsActiveWindowProperty
Field Value
System.
|
IsDraggingProperty
Identifies the
Declaration
public static readonly DependencyProperty IsDraggingProperty
Field Value
System.
|
IsInActiveStateProperty
Identifies the
Declaration
public static readonly DependencyProperty IsInActiveStateProperty
Field Value
System.
|
IsModalProperty
Identifies the
Declaration
public static readonly DependencyProperty IsModalProperty
Field Value
System.
|
IsOpenProperty
Identifies the
Declaration
public static readonly DependencyProperty IsOpenProperty
Field Value
System.
|
IsResizingProperty
Identifies the
Declaration
public static readonly DependencyProperty IsResizingProperty
Field Value
System.
|
IsTopmostProperty
Identifies the IsTopmost dependency property.
Declaration
public static readonly DependencyProperty IsTopmostProperty
Field Value
System.
|
LeftProperty
Identifies the
Declaration
public static readonly DependencyProperty LeftProperty
Field Value
System.
|
ResizeBorderProperty
Identifies the ResizeBorder dependency property.
Declaration
public static readonly DependencyProperty ResizeBorderProperty
Field Value
System.
|
ResizeModeProperty
Identifies the
Declaration
public static readonly DependencyProperty ResizeModeProperty
Field Value
System.
|
SizeToContentProperty
Identifies the
Declaration
public static readonly DependencyProperty SizeToContentProperty
Field Value
System.
|
TopProperty
Identifies the
Declaration
public static readonly DependencyProperty TopProperty
Field Value
System.
|
WindowStateProperty
Identifies the
Declaration
public static readonly DependencyProperty WindowStateProperty
Field Value
System.
|
Properties
CanClose
Gets or sets whether Window
Declaration
public bool CanClose { get; set; }
Property Value
System.
|
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 Window
Declaration
public bool CanMove { get; set; }
Property Value
System.
|
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
public double CaptionHeight { get; set; }
Property Value
System.
|
CornerRadius
Gets or sets the CornerRadius property.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
System.
|
HideMaximizeButton
Gets or sets the visibility of the Maximize button.
Declaration
public bool HideMaximizeButton { get; set; }
Property Value
System.
|
HideMinimizeButton
Gets or sets the visibility of the Minimize button.
Declaration
public bool HideMinimizeButton { get; set; }
Property Value
System.
|
IsActiveWindow
Gets a value indicating whether this instance is active. This is a dependency property.
Declaration
public bool IsActiveWindow { get; }
Property Value
System.
|
IsDragging
Gets a value indicating whether this instance is dragging. This is a dependency property.
Declaration
public bool IsDragging { get; protected set; }
Property Value
System.
|
IsInActiveState
Gets a value indicating whether this instance should appear active. It is not necessary equal to IsActiveWindow. This is a read only dependency property.
Declaration
public bool IsInActiveState { get; }
Property Value
System.
|
IsLayoutChanging
Gets a value indicating whether this instance is layout changing.
Declaration
public bool IsLayoutChanging { get; }
Property Value
System.
|
Implements
IsModal
Gets a value that represents whether the WindowBase is modal. This is a dependency property.
Declaration
public bool IsModal { get; }
Property Value
System.
|
IsOpen
Gets a value that represents whether the WindowBase is open. This is a dependency property.
Declaration
public bool IsOpen { get; protected set; }
Property Value
System.
|
IsResizing
Gets a value indicating whether this instance is resizing. This is a dependency property.
Declaration
public bool IsResizing { get; protected set; }
Property Value
System.
|
IsTopmost
Gets or sets whether the Window
Declaration
public bool IsTopmost { get; set; }
Property Value
System.
|
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
public double Left { get; set; }
Property Value
System.
|
Owner
Gets or sets the Owner of the Window
Declaration
public ContentControl Owner { get; set; }
Property Value
System.
|
ResizeBorder
Get the bounds of the resize grips on the Window.
Declaration
public Thickness ResizeBorder { get; set; }
Property Value
System.
|
ResizeMode
Gets or sets a ResizeMode value for the Window
Declaration
public ResizeMode ResizeMode { get; set; }
Property Value
System.
|
SizeToContent
The value of this property is ignored if the Width and Height properties are set.
Declaration
public bool SizeToContent { get; set; }
Property Value
System.
|
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
public double Top { get; set; }
Property Value
System.
|
WindowState
Gets or sets a Window
Declaration
public WindowState WindowState { get; set; }
Property Value
System.
|
Methods
BringToFront()
Attempts to bring the Window
Declaration
public void BringToFront()
Remarks
Whenever opened Window
ChangeVisualState()
Updates the visual state of the control.
Declaration
protected void ChangeVisualState()
ChangeVisualState(Boolean)
Updates the visual state of the control.
Declaration
protected virtual void ChangeVisualState(bool useTransitions)
Parameters
System. Indicates whether transitions should be used. |
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
protected virtual bool CheckCanClose()
Returns
System.
|
Close()
Manually closes Window
Declaration
public void Close()
Remarks
Raises
Examples
WindowBase window = new WindowBase();
window.Height = 100;
window.Width = 100;
window.Header = "WindowBase";
window.Content = "This is your content";
window.Show();
window.Close();
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
protected void CloseWithoutEventsAndAnimations()
GetApplicationSize()
Gets the application size depending on the platform.
Declaration
protected Size GetApplicationSize()
Returns
System.
|
GetNormalSizeAndPosition()
Gets the size and position of the Window
Declaration
public Rect GetNormalSizeAndPosition()
Returns
System. A rectangle with the Left, Top, Width and Height properties of the Window |
GetWindowOwner()
Declaration
protected virtual ContentControl GetWindowOwner()
Returns
System.
|
GetWindowOwnerHandle()
Declaration
protected virtual IntPtr GetWindowOwnerHandle()
Returns
System.
|
GetWindowStartupLocation()
Declaration
protected virtual WindowStartupLocation GetWindowStartupLocation()
Returns
System.
|
GetZIndex()
Declaration
public virtual int GetZIndex()
Returns
System.
|
OnActivated(EventArgs)
Raises the Activated event. This method is called when the window is activated.
Declaration
protected virtual void OnActivated(EventArgs e)
Parameters
System. The System. |
OnCloseAnimationFinished()
Declaration
protected virtual void OnCloseAnimationFinished()
OnClosed()
Declaration
protected virtual void OnClosed()
OnClosing()
Declaration
protected virtual bool OnClosing()
Returns
System.
|
OnCreateAutomationPeer()
Create the automation peer for this class.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.
|
OnDeactivated(EventArgs)
Raises the Deactivated event. This method is called when the window is deactivated.
Declaration
protected virtual void OnDeactivated(EventArgs e)
Parameters
System. The System. |
OnDragDelta(Point, Rect, Rect, Boolean)
Declaration
protected virtual Rect OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, bool isResize)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
OnDragEnd(Point, Boolean, Boolean)
Declaration
protected virtual void OnDragEnd(Point globalMousePosition, bool isCancel, bool isResize)
Parameters
System.
|
System.
|
System.
|
OnDragStart(Point, Boolean)
Declaration
protected virtual void OnDragStart(Point globalMousePosition, bool isResize)
Parameters
System.
|
System.
|
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
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.
Declaration
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
System. The System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data. |
OnHostCreated(HostWindowCreatedEventArgs)
Raises the Host
Declaration
protected virtual void OnHostCreated(HostWindowCreatedEventArgs args)
Parameters
Host The Host |
OnLayoutChangeEnded()
Declaration
protected void OnLayoutChangeEnded()
OnLayoutChangeEnded(EventArgs)
Raises the Layout
Declaration
protected virtual void OnLayoutChangeEnded(EventArgs args)
Parameters
System. The System. |
OnLayoutChangeStarted()
Declaration
protected void OnLayoutChangeStarted()
OnLayoutChangeStarted(EventArgs)
Raises the Layout
Declaration
protected virtual void OnLayoutChangeStarted(EventArgs args)
Parameters
System. The System. |
OnLocationChanged(EventArgs)
Raises the Location
Declaration
protected virtual void OnLocationChanged(EventArgs args)
Parameters
System. The System. |
OnRightMouseButtonUp()
Declaration
protected virtual void OnRightMouseButtonUp()
OnRootVisualSizeChanged()
Declaration
protected virtual void OnRootVisualSizeChanged()
OnShowAnimationFinished()
Declaration
protected virtual void OnShowAnimationFinished()
OnWindowStateChanged(EventArgs)
Raises the Window
Declaration
protected virtual void OnWindowStateChanged(EventArgs args)
Parameters
System. The System. |
ShouldActivate()
Indicates whether the Window should be activated when the focus goes to it.
Declaration
protected virtual bool ShouldActivate()
Returns
System.
|
ShouldActivateOnShow()
Declaration
protected virtual bool ShouldActivateOnShow()
Returns
System.
|
ShouldFocusOnActivate()
Declaration
protected virtual bool ShouldFocusOnActivate()
Returns
System.
|
ShouldShowInTaskSwitcher()
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).
Declaration
protected virtual bool ShouldShowInTaskSwitcher()
Returns
System.
|
ShouldSystemMenuOnRightClick()
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 Window
Declaration
protected virtual bool ShouldSystemMenuOnRightClick()
Returns
System.
|
ShowWindow(Boolean)
Shows the window either modally or not. This method should be used in the subclasses to open the window.
Declaration
protected virtual void ShowWindow(bool isModal)
Parameters
System. Whether the window is modal or not. |
Events
Activated
Occurs when the Window is activated.
Declaration
public event EventHandler Activated
Event Type
System.
|
Deactivated
Occurs when the Window is deactivated.
Declaration
public event EventHandler Deactivated
Event Type
System.
|
LayoutChangeEnded
Occurs when a layout change is ended.
Declaration
public event EventHandler LayoutChangeEnded
Event Type
System.
|
Implements
LayoutChangeStarted
Occurs when a layout change is started.
Declaration
public event EventHandler LayoutChangeStarted
Event Type
System.
|
Implements
LocationChanged
Occurs when the value of a Left or Top changes.
Declaration
[SRCategory("Behavior")]
public event EventHandler LocationChanged
Event Type
System.
|
WindowStateChanged
Occurs when the value of a WindowState changes.
Declaration
[SRCategory("Behavior")]
public event EventHandler WindowStateChanged
Event Type
System.
|
Remarks
The event is raised whenever the
Explicit Interface Implementations
IDragAware.OnDragDelta(Point, Rect, Rect, Boolean)
Declaration
Rect IDragAware.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, bool isResize)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
Implements
IDragAware.OnDragEnd(Point, Boolean, Boolean)
Declaration
void IDragAware.OnDragEnd(Point globalMousePosition, bool isCancel, bool isResize)
Parameters
System.
|
System.
|
System.
|
Implements
IDragAware.OnDragStart(Point, Boolean)
Declaration
void IDragAware.OnDragStart(Point globalMousePosition, bool isResize)
Parameters
System.
|
System.
|