C# Class WinRTXamlToolkit.Controls.ToolWindow

Inheritance: Windows.UI.Xaml.Controls.ContentControl
Mostra file Open project: xyzzer/WinRTXamlToolkit

Public Properties

Property Type Description
CanCloseProperty Windows.UI.Xaml.DependencyProperty
CanDragAnywhereProperty Windows.UI.Xaml.DependencyProperty
CanMaximizeProperty Windows.UI.Xaml.DependencyProperty
CanResizeProperty Windows.UI.Xaml.DependencyProperty
CanSnapToEdgeProperty Windows.UI.Xaml.DependencyProperty
TitleBackgroundBrushProperty Windows.UI.Xaml.DependencyProperty
TitleProperty Windows.UI.Xaml.DependencyProperty
TitleTemplateProperty Windows.UI.Xaml.DependencyProperty
WindowEdgeSnapBehaviorProperty Windows.UI.Xaml.DependencyProperty
WindowMovableAreaEdgeThicknessProperty Windows.UI.Xaml.DependencyProperty
WindowMovableAreaProperty Windows.UI.Xaml.DependencyProperty
WindowStartupLocationProperty Windows.UI.Xaml.DependencyProperty
WindowStateProperty Windows.UI.Xaml.DependencyProperty
XProperty Windows.UI.Xaml.DependencyProperty
YProperty Windows.UI.Xaml.DependencyProperty

Public Methods

Method Description
ActivateAsync ( ) : System.Threading.Tasks.Task

Activates the window. The method can be awaited to wait for the unsnap animation to complete.

Close ( ) : void

Closes the window.

Hide ( ) : void

Hides the window.

Maximize ( ) : void

Maximizes the window

MinimizeAsync ( ) : System.Threading.Tasks.Task

Minimizes the window.

RestoreAsync ( ) : System.Threading.Tasks.Task

Restores the window

Show ( ) : void

Shows the window.

SnapToEdgeAsync ( ) : System.Threading.Tasks.Task

Snaps to nearest edge.

ToolWindow ( ) : System

Initializes a new instance of the ToolWindow class.

Protected Methods

Method Description
OnApplyTemplate ( ) : void

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.

OnCanCloseChanged ( bool oldCanClose, bool newCanClose ) : void

Provides derived classes an opportunity to handle changes to the CanClose property.

OnCanDragAnywhereChanged ( bool oldCanDragAnywhere, bool newCanDragAnywhere ) : void

Provides derived classes an opportunity to handle changes to the CanDragAnywhere property.

OnCanMaximizeChanged ( bool oldCanMaximize, bool newCanMaximize ) : void

Provides derived classes an opportunity to handle changes to the CanMaximize property.

OnCanResizeChanged ( bool oldCanResize, bool newCanResize ) : void

Provides derived classes an opportunity to handle changes to the CanResize property.

OnCanSnapToEdgeChanged ( bool oldCanSnapToEdge, bool newCanSnapToEdge ) : void

Provides derived classes an opportunity to handle changes to the CanSnapToEdge property.

OnTitleChanged ( object oldTitle, object newTitle ) : void

Provides derived classes an opportunity to handle changes to the Title property.

OnTitleTemplateChanged ( DataTemplate oldTitleTemplate, DataTemplate newTitleTemplate ) : void

Provides derived classes an opportunity to handle changes to the TitleTemplate property.

OnWindowEdgeSnapBehaviorChanged ( WindowEdgeSnapBehavior oldWindowEdgeSnapBehavior, WindowEdgeSnapBehavior newWindowEdgeSnapBehavior ) : void

Provides derived classes an opportunity to handle changes to the WindowEdgeSnapBehavior property.

OnWindowMovableAreaChanged ( WindowMovableArea oldWindowMovableArea, WindowMovableArea newWindowMovableArea ) : void

Provides derived classes an opportunity to handle changes to the WindowMovableArea property.

OnWindowMovableAreaEdgeThicknessChanged ( Thickness oldWindowMovableAreaEdgeThickness, Thickness newWindowMovableAreaEdgeThickness ) : void

Provides derived classes an opportunity to handle changes to the WindowMovableAreaEdgeThickness property.

OnWindowStartupLocationChanged ( WindowStartupLocation oldWindowStartupLocation, WindowStartupLocation newWindowStartupLocation ) : void

Provides derived classes an opportunity to handle changes to the WindowStartupLocation property.

OnWindowStateChanged ( WindowStates oldWindowState, WindowStates newWindowState ) : void

Provides derived classes an opportunity to handle changes to the WindowState property.

OnXChanged ( double oldX, double newX ) : void

Provides derived classes an opportunity to handle changes to the X property.

OnYChanged ( double oldY, double newY ) : void

Provides derived classes an opportunity to handle changes to the Y property.

Private Methods

Method Description
AnimateRotatedSnapAsync ( double x, double y, double angle ) : System.Threading.Tasks.Task
AnimateStraightSnapAsync ( double x, double y ) : System.Threading.Tasks.Task
AnimateToStraightenAsync ( ) : System.Threading.Tasks.Task
CleanupSnapProperties ( ) : void
FilterOutManipulations ( UIElement element ) : void
GetDesiredPosition ( double startx, double starty, double &angle, Edges &edge ) : DoublePoint

Calculates the desired position, rotation and snapping edge given the position of the window.

GetMovableArea ( ) : Rect

Gets the range of X,Y window position values acceptable for the window

HookUpEvents ( ) : void
HookUpSizingThumbManipulations ( Rectangle thumb ) : void
InitializeStartupLocation ( ) : void
OnBorderManipulationCompleted ( object sender, ManipulationCompletedRoutedEventArgs e ) : void
OnBorderManipulationDelta ( object sender, ManipulationDeltaRoutedEventArgs e ) : void
OnBorderManipulationInertiaStarting ( object sender, ManipulationInertiaStartingRoutedEventArgs e ) : void
OnBorderManipulationStarting ( object sender, ManipulationStartedRoutedEventArgs e ) : void
OnBorderPointerPressed ( object sender, PointerRoutedEventArgs e ) : void
OnBorderThicknessChanged ( object sender, Thickness thickness ) : void
OnCanCloseChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the CanClose property.

OnCanDragAnywhereChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the CanDragAnywhere property.

OnCanMaximizeChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the CanMaximize property.

OnCanResizeChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the CanResize property.

OnCanSnapToEdgeChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the CanSnapToEdge property.

OnCloseButtonClick ( object sender, RoutedEventArgs e ) : void
OnFilteredOutManipulationStarted ( object sender, ManipulationStartedRoutedEventArgs e ) : void
OnFilteredOutManipulationStarting ( object sender, ManipulationStartingRoutedEventArgs e ) : void
OnLoaded ( object sender, RoutedEventArgs e ) : void
OnMaximizeButtonClick ( object sender, RoutedEventArgs e ) : void
OnMinimizeButtonClick ( object sender, RoutedEventArgs e ) : void
OnParentSizeChanged ( object sender, SizeChangedEventArgs e ) : void
OnRestoreButtonClick ( object sender, RoutedEventArgs e ) : void
OnSnapButtonClick ( object sender, RoutedEventArgs e ) : void
OnThumbManipulationDelta ( object sender, ManipulationDeltaRoutedEventArgs e ) : void
OnTitleChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Title property.

OnTitleGridSizeChanged ( object sender, SizeChangedEventArgs e ) : void
OnTitleTemplateChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the TitleTemplate property.

OnUnloaded ( object sender, RoutedEventArgs e ) : void
OnWindowEdgeSnapBehaviorChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the WindowEdgeSnapBehavior property.

OnWindowMovableAreaChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the WindowMovableArea property.

OnWindowMovableAreaEdgeThicknessChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the WindowMovableAreaEdgeThickness property.

OnWindowStartupLocationChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the WindowStartupLocation property.

OnWindowStateChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the WindowState property.

OnXChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the X property.

OnYChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Y property.

RaiseClosed ( ) : void
RaiseClosing ( ) : bool

Raises the closing event.

SnapToEdgeIfNecessary ( ) : void
StopCurrentSnapStoryboard ( ) : void
UnFilterOutManipulations ( UIElement element ) : void
UnhookEvents ( ) : void
UpdateSizingThumbSizes ( ) : void

Update the sizes of the sizing thumbs.

UpdateVisualStates ( bool useTransitions ) : void

Updates the visual states.

Method Details

ActivateAsync() public method

Activates the window. The method can be awaited to wait for the unsnap animation to complete.
public ActivateAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Close() public method

Closes the window.
public Close ( ) : void
return void

Hide() public method

Hides the window.
public Hide ( ) : void
return void

Maximize() public method

Maximizes the window
public Maximize ( ) : void
return void

MinimizeAsync() public method

Minimizes the window.
public MinimizeAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

OnApplyTemplate() protected method

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.
protected OnApplyTemplate ( ) : void
return void

OnCanCloseChanged() protected method

Provides derived classes an opportunity to handle changes to the CanClose property.
protected OnCanCloseChanged ( bool oldCanClose, bool newCanClose ) : void
oldCanClose bool The old CanClose value
newCanClose bool The new CanClose value
return void

OnCanDragAnywhereChanged() protected method

Provides derived classes an opportunity to handle changes to the CanDragAnywhere property.
protected OnCanDragAnywhereChanged ( bool oldCanDragAnywhere, bool newCanDragAnywhere ) : void
oldCanDragAnywhere bool The old CanDragAnywhere value
newCanDragAnywhere bool The new CanDragAnywhere value
return void

OnCanMaximizeChanged() protected method

Provides derived classes an opportunity to handle changes to the CanMaximize property.
protected OnCanMaximizeChanged ( bool oldCanMaximize, bool newCanMaximize ) : void
oldCanMaximize bool The old CanMaximize value
newCanMaximize bool The new CanMaximize value
return void

OnCanResizeChanged() protected method

Provides derived classes an opportunity to handle changes to the CanResize property.
protected OnCanResizeChanged ( bool oldCanResize, bool newCanResize ) : void
oldCanResize bool The old CanResize value
newCanResize bool The new CanResize value
return void

OnCanSnapToEdgeChanged() protected method

Provides derived classes an opportunity to handle changes to the CanSnapToEdge property.
protected OnCanSnapToEdgeChanged ( bool oldCanSnapToEdge, bool newCanSnapToEdge ) : void
oldCanSnapToEdge bool The old CanSnapToEdge value
newCanSnapToEdge bool The new CanSnapToEdge value
return void

OnTitleChanged() protected method

Provides derived classes an opportunity to handle changes to the Title property.
protected OnTitleChanged ( object oldTitle, object newTitle ) : void
oldTitle object The old Title value
newTitle object The new Title value
return void

OnTitleTemplateChanged() protected method

Provides derived classes an opportunity to handle changes to the TitleTemplate property.
protected OnTitleTemplateChanged ( DataTemplate oldTitleTemplate, DataTemplate newTitleTemplate ) : void
oldTitleTemplate Windows.UI.Xaml.DataTemplate The old TitleTemplate value
newTitleTemplate Windows.UI.Xaml.DataTemplate The new TitleTemplate value
return void

OnWindowEdgeSnapBehaviorChanged() protected method

Provides derived classes an opportunity to handle changes to the WindowEdgeSnapBehavior property.
protected OnWindowEdgeSnapBehaviorChanged ( WindowEdgeSnapBehavior oldWindowEdgeSnapBehavior, WindowEdgeSnapBehavior newWindowEdgeSnapBehavior ) : void
oldWindowEdgeSnapBehavior WindowEdgeSnapBehavior The old WindowEdgeSnapBehavior value
newWindowEdgeSnapBehavior WindowEdgeSnapBehavior The new WindowEdgeSnapBehavior value
return void

OnWindowMovableAreaChanged() protected method

Provides derived classes an opportunity to handle changes to the WindowMovableArea property.
protected OnWindowMovableAreaChanged ( WindowMovableArea oldWindowMovableArea, WindowMovableArea newWindowMovableArea ) : void
oldWindowMovableArea WindowMovableArea The old WindowMovableArea value
newWindowMovableArea WindowMovableArea The new WindowMovableArea value
return void

OnWindowMovableAreaEdgeThicknessChanged() protected method

Provides derived classes an opportunity to handle changes to the WindowMovableAreaEdgeThickness property.
protected OnWindowMovableAreaEdgeThicknessChanged ( Thickness oldWindowMovableAreaEdgeThickness, Thickness newWindowMovableAreaEdgeThickness ) : void
oldWindowMovableAreaEdgeThickness Windows.UI.Xaml.Thickness The old WindowMovableAreaEdgeThickness value
newWindowMovableAreaEdgeThickness Windows.UI.Xaml.Thickness The new WindowMovableAreaEdgeThickness value
return void

OnWindowStartupLocationChanged() protected method

Provides derived classes an opportunity to handle changes to the WindowStartupLocation property.
protected OnWindowStartupLocationChanged ( WindowStartupLocation oldWindowStartupLocation, WindowStartupLocation newWindowStartupLocation ) : void
oldWindowStartupLocation WindowStartupLocation The old WindowStartupLocation value
newWindowStartupLocation WindowStartupLocation The new WindowStartupLocation value
return void

OnWindowStateChanged() protected method

Provides derived classes an opportunity to handle changes to the WindowState property.
protected OnWindowStateChanged ( WindowStates oldWindowState, WindowStates newWindowState ) : void
oldWindowState WindowStates The old WindowState value
newWindowState WindowStates The new WindowState value
return void

OnXChanged() protected method

Provides derived classes an opportunity to handle changes to the X property.
protected OnXChanged ( double oldX, double newX ) : void
oldX double The old X value
newX double The new X value
return void

OnYChanged() protected method

Provides derived classes an opportunity to handle changes to the Y property.
protected OnYChanged ( double oldY, double newY ) : void
oldY double The old Y value
newY double The new Y value
return void

RestoreAsync() public method

Restores the window
public RestoreAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Show() public method

Shows the window.
public Show ( ) : void
return void

SnapToEdgeAsync() public method

Snaps to nearest edge.
public SnapToEdgeAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

ToolWindow() public method

Initializes a new instance of the ToolWindow class.
public ToolWindow ( ) : System
return System

Property Details

CanCloseProperty public_oe static_oe property

CanClose Dependency Property
public static DependencyProperty,Windows.UI.Xaml CanCloseProperty
return Windows.UI.Xaml.DependencyProperty

CanDragAnywhereProperty public_oe static_oe property

CanDragAnywhere Dependency Property
public static DependencyProperty,Windows.UI.Xaml CanDragAnywhereProperty
return Windows.UI.Xaml.DependencyProperty

CanMaximizeProperty public_oe static_oe property

CanMaximize Dependency Property
public static DependencyProperty,Windows.UI.Xaml CanMaximizeProperty
return Windows.UI.Xaml.DependencyProperty

CanResizeProperty public_oe static_oe property

CanResize Dependency Property
public static DependencyProperty,Windows.UI.Xaml CanResizeProperty
return Windows.UI.Xaml.DependencyProperty

CanSnapToEdgeProperty public_oe static_oe property

CanSnapToEdge Dependency Property
public static DependencyProperty,Windows.UI.Xaml CanSnapToEdgeProperty
return Windows.UI.Xaml.DependencyProperty

TitleBackgroundBrushProperty public_oe static_oe property

TitleBackgroundBrush Dependency Property
public static DependencyProperty,Windows.UI.Xaml TitleBackgroundBrushProperty
return Windows.UI.Xaml.DependencyProperty

TitleProperty public_oe static_oe property

Title Dependency Property
public static DependencyProperty,Windows.UI.Xaml TitleProperty
return Windows.UI.Xaml.DependencyProperty

TitleTemplateProperty public_oe static_oe property

TitleTemplate Dependency Property
public static DependencyProperty,Windows.UI.Xaml TitleTemplateProperty
return Windows.UI.Xaml.DependencyProperty

WindowEdgeSnapBehaviorProperty public_oe static_oe property

WindowEdgeSnapBehavior Dependency Property
public static DependencyProperty,Windows.UI.Xaml WindowEdgeSnapBehaviorProperty
return Windows.UI.Xaml.DependencyProperty

WindowMovableAreaEdgeThicknessProperty public_oe static_oe property

WindowMovableAreaEdgeThickness Dependency Property
public static DependencyProperty,Windows.UI.Xaml WindowMovableAreaEdgeThicknessProperty
return Windows.UI.Xaml.DependencyProperty

WindowMovableAreaProperty public_oe static_oe property

WindowMovableArea Dependency Property
public static DependencyProperty,Windows.UI.Xaml WindowMovableAreaProperty
return Windows.UI.Xaml.DependencyProperty

WindowStartupLocationProperty public_oe static_oe property

WindowStartupLocation Dependency Property
public static DependencyProperty,Windows.UI.Xaml WindowStartupLocationProperty
return Windows.UI.Xaml.DependencyProperty

WindowStateProperty public_oe static_oe property

WindowState Dependency Property
public static DependencyProperty,Windows.UI.Xaml WindowStateProperty
return Windows.UI.Xaml.DependencyProperty

XProperty public_oe static_oe property

X Dependency Property
public static DependencyProperty,Windows.UI.Xaml XProperty
return Windows.UI.Xaml.DependencyProperty

YProperty public_oe static_oe property

Y Dependency Property
public static DependencyProperty,Windows.UI.Xaml YProperty
return Windows.UI.Xaml.DependencyProperty