C# Class SilverFlow.Controls.FloatingWindow

Inheritance: System.Windows.Controls.ContentControl, IResizableElement, IDisposable
显示文件 Open project: Zoomicon/ZUI Class Usage Examples

Public Properties

Property Type Description
CloseButtonStyleProperty System.Windows.DependencyProperty
FlowDirectionProperty System.Windows.DependencyProperty
IconProperty System.Windows.DependencyProperty
IconTextProperty System.Windows.DependencyProperty
MaximizeButtonStyleProperty System.Windows.DependencyProperty
MinimizeButtonStyleProperty System.Windows.DependencyProperty
PositionProperty System.Windows.DependencyProperty
ResizeEnabledProperty System.Windows.DependencyProperty
ResizingAreaThicknessProperty DependencyProperty
RestoreButtonStyleProperty DependencyProperty
ShowCloseButtonProperty DependencyProperty
ShowInIconbarProperty DependencyProperty
ShowMaximizeButtonProperty DependencyProperty
ShowMinimizeButtonProperty DependencyProperty
ShowRestoreButtonProperty DependencyProperty
TitleBackgroundProperty DependencyProperty
TitleProperty DependencyProperty
TitleStyleProperty DependencyProperty

Private Properties

Property Type Description
ActiveWindowChanged void
Application_Exit void
CaptureMouseCursor void
CheckHost void
CloseButton_Click void
Closing_Completed void
ContentRoot_SizeChanged void
EnsureVisible void
FloatingWindow_MouseLeftButtonDown void
GetAppSettingsKey string
GetCurrentWindowPosition Point
GetStoryboards void
GetThumbnailImage ImageSource
Host_SizeChanged void
InertialMotion_Completed void
InitializeContentRootTransformGroup void
IsMouseOverButtons bool
MaximizeButton_Click void
Maximizing_Completed void
MinimizeButton_Click void
MoveWindow void
OnCloseButtonStylePropertyChanged void
OnMaximizeButtonStylePropertyChanged void
OnMinimizeButtonStylePropertyChanged void
OnPositionPropertyChanged void
OnResizingAreaThicknessPropertyChanged void
OnRestoreButtonStylePropertyChanged void
OnShowCloseButtonPropertyChanged void
OnTitleStylePropertyChanged void
Opening_Completed void
RestoreButton_Click void
RestoreMaximizedWindow void
RestoringMaximized_Completed void
RestoringMinimized_Completed void
SaveActualSize void
SaveSizeAndPosition void
SetInitialRootPosition void
SetStyles void
SetTopmost void
ShowMaximizeButtonPropertyChanged void
ShowMinimizeButtonPropertyChanged void
ShowRestoreButtonPropertyChanged void
ShowWindow void
ShowWindow void
StartMaximizingAnimation void
StartRestoringAnimation void
StopInertialMotion void
SubscribeToEvents void
SubscribeToStoryBoardEvents void
SubscribeToTemplatePartEvents void
UnSubscribeFromEvents void
UnsubscribeFromStoryBoardEvents void
UnsubscribeFromTemplatePartEvents void

Public Methods

Method Description
Activate ( ) : void

Makes the window topmost and tries to set focus on it.

Close ( ) : void

Closes a FloatingWindow.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FloatingWindow ( ) : System

Initializes a new instance of the FloatingWindow class.

MaximizeWindow ( ) : void

Maximizes the window.

MinimizeWindow ( ) : void

Minimizes the window.

OnApplyTemplate ( ) : void

Builds the visual tree for the FloatingWindow control when a new template is applied.

RestoreSizeAndPosition ( ) : void

Restores the size and position stored in the IsolatedStorage on closing.

RestoreWindow ( ) : void

Restores window state, size and its position.

Show ( ) : void

Opens the FloatingWindow in previously saved position or in the center of the FloatingWindowHost.

Show ( Point point ) : void

Shows the window in the specified coordinates, relative to the window's Host.

Show ( Thickness margins ) : void

Shows a FloatingWindow at maximal size taking into account specified margins and current FloatingWindowHost size.

Show ( double x, double y ) : void

Shows the window in the specified coordinates, relative to the window's Host.

ShowModal ( ) : void

Shows the window as a modal one.

Protected Methods

Method Description
OnActivated ( EventArgs e ) : void

Raises the FloatingWindow.Activated event.

OnClosed ( EventArgs e ) : void

Raises the FloatingWindow.Closed event.

OnClosing ( CancelEventArgs e ) : void

Raises the FloatingWindow.Closing event.

OnDeactivated ( EventArgs e ) : void

Raises the FloatingWindow.Deactivated event.

OnMaximized ( EventArgs e ) : void

Raises the FloatingWindow.Maximized event.

OnMinimized ( EventArgs e ) : void

Raises the FloatingWindow.Minimized event.

OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void

Executed when mouse left button is down.

OnMouseLeftButtonUp ( System.Windows.Input.MouseButtonEventArgs e ) : void

Executed when mouse left button is up.

OnMouseMove ( System.Windows.Input.MouseEventArgs e ) : void

Executed when mouse moves.

OnOpened ( ) : void

This method is called every time a FloatingWindow is displayed.

OnRestored ( EventArgs e ) : void

Raises the FloatingWindow.Restored event.

Private Methods

Method Description
ActiveWindowChanged ( object sender, ActiveWindowChangedEventArgs e ) : void

Handles the ActiveWindowChanged event of the Host control.

Application_Exit ( object sender, EventArgs e ) : void

Executed when the application is exited.

CaptureMouseCursor ( ) : void

Captures the mouse cursor.

CheckHost ( ) : void

Checks if the floating window was added to the FloatingWindowHost.

CloseButton_Click ( object sender, RoutedEventArgs e ) : void

Executed when the Close button is clicked.

Closing_Completed ( object sender, EventArgs e ) : void

Executed when the Closing storyboard ends.

ContentRoot_SizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void

Handles the SizeChanged event of the ContentRoot control to update window position only once when the window is opened.

EnsureVisible ( ) : void

Ensures the window is visible.

FloatingWindow_MouseLeftButtonDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Handles the MouseLeftButtonDown event to bring the window to the front.

GetAppSettingsKey ( string key ) : string

Gets the application settings key used to store properties in the IsolatedStorage.

GetCurrentWindowPosition ( ) : Point

Gets current window position taking into account animation effects.

GetStoryboards ( ) : void

Gets the storyboards defined in the FloatingWindow style.

GetThumbnailImage ( ) : ImageSource

Creates a thumbnail of the window.

Host_SizeChanged ( object sender, System.Windows.SizeChangedEventArgs e ) : void

Updates clipping region on host SizeChanged event.

InertialMotion_Completed ( object sender, EventArgs e ) : void

Handles the Completed event of the InertialMotionStoryboard.

InitializeContentRootTransformGroup ( ) : void

Checks the TransformGroup of the content root or creates it if necesary.

IsMouseOverButtons ( Point position, UIElement origin ) : bool

Determines whether the mouse is over buttons in the the specified mouse position.

MaximizeButton_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the MaximizeButton control.

Maximizing_Completed ( object sender, EventArgs e ) : void

Handles the Completed event of the Maximizing animation.

MinimizeButton_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the MinimizeButton control.

MoveWindow ( Point point ) : void

Moves the window to the specified coordinates.

OnCloseButtonStylePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

CloseButtonStyle PropertyChangedCallback call back static function.

OnMaximizeButtonStylePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

MaximizeButtonStyle PropertyChangedCallback call back static function.

OnMinimizeButtonStylePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

CloseButtonStyle PropertyChangedCallback call back static function.

OnPositionPropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

PositionProperty PropertyChangedCallback call back static function.

OnResizingAreaThicknessPropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

ResizingAreaThicknessProperty PropertyChangedCallback call back static function.

OnRestoreButtonStylePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

RestoreButtonStyle PropertyChangedCallback call back static function.

OnShowCloseButtonPropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

ShowCloseButtonProperty PropertyChangedCallback call back static function.

OnTitleStylePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

TitleStyle PropertyChangedCallback call back static function.

Opening_Completed ( object sender, EventArgs e ) : void

Executed when the opening storyboard finishes.

RestoreButton_Click ( object sender, RoutedEventArgs e ) : void

Handles the Click event of the RestoreButton control.

RestoreMaximizedWindow ( ) : void

Restores maximized window position and size.

RestoringMaximized_Completed ( object sender, EventArgs e ) : void

Handles the Completed event of the Restoring Maximized window animation.

RestoringMinimized_Completed ( object sender, EventArgs e ) : void

Handles the Completed event of the Restoring Minimized window animation.

SaveActualSize ( ) : void

Saves the actual size if it was not set explicitly set. E.g. the Width can be NaN, that means "Auto".

SaveSizeAndPosition ( ) : void

Saves current size and position of the window in the IsolatedStorage. The key of the settings is the Tag of the window (if not null).

SetInitialRootPosition ( ) : void

Shift the root of the window to compensate its margins.

SetStyles ( ) : void

Sets styles that are applied for different template parts.

SetTopmost ( ) : void

Brings current window to the front.

ShowMaximizeButtonPropertyChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

ShowMaximizeButtonProperty PropertyChangedCallback call back static function.

ShowMinimizeButtonPropertyChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

ShowMinimizeButtonProperty PropertyChangedCallback call back static function.

ShowRestoreButtonPropertyChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

ShowRestoreButtonProperty PropertyChangedCallback call back static function.

ShowWindow ( Point point ) : void

Shows the window in the specified coordinates, relative to the window's Host.

ShowWindow ( Thickness margins ) : void

Shows a FloatingWindow at maximal size taking into account specified margins and current FloatingWindowHost size.

StartMaximizingAnimation ( ) : void

Starts maximizing animation.

StartRestoringAnimation ( ) : void

Starts restoring animation.

StopInertialMotion ( ) : void

Stops current inertial motion.

SubscribeToEvents ( ) : void

Subscribes to events when the window is opened.

SubscribeToStoryBoardEvents ( ) : void

Subscribes to the events on the storyboards.

SubscribeToTemplatePartEvents ( ) : void

Subscribes to the events on the template parts.

UnSubscribeFromEvents ( ) : void

Unsubscribe from events when the ChildWindow is closed.

UnsubscribeFromStoryBoardEvents ( ) : void

Unsubscribe from events that are subscribed on the storyboards.

UnsubscribeFromTemplatePartEvents ( ) : void

Unsubscribe from the events that are subscribed on the template part elements.

Method Details

Activate() public method

Makes the window topmost and tries to set focus on it.
public Activate ( ) : void
return void

Close() public method

Closes a FloatingWindow.
public Close ( ) : void
return void

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

FloatingWindow() public method

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

MaximizeWindow() public method

Maximizes the window.
public MaximizeWindow ( ) : void
return void

MinimizeWindow() public method

Minimizes the window.
public MinimizeWindow ( ) : void
return void

OnActivated() protected method

Raises the FloatingWindow.Activated event.
protected OnActivated ( EventArgs e ) : void
e System.EventArgs The event data.
return void

OnApplyTemplate() public method

Builds the visual tree for the FloatingWindow control when a new template is applied.
public OnApplyTemplate ( ) : void
return void

OnClosed() protected method

Raises the FloatingWindow.Closed event.
protected OnClosed ( EventArgs e ) : void
e System.EventArgs The event data.
return void

OnClosing() protected method

Raises the FloatingWindow.Closing event.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs The event data.
return void

OnDeactivated() protected method

Raises the FloatingWindow.Deactivated event.
protected OnDeactivated ( EventArgs e ) : void
e System.EventArgs The event data.
return void

OnMaximized() protected method

Raises the FloatingWindow.Maximized event.
protected OnMaximized ( EventArgs e ) : void
e System.EventArgs The event data.
return void

OnMinimized() protected method

Raises the FloatingWindow.Minimized event.
protected OnMinimized ( EventArgs e ) : void
e System.EventArgs The event data.
return void

OnMouseLeftButtonDown() protected method

Executed when mouse left button is down.
protected OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs The data for the event.
return void

OnMouseLeftButtonUp() protected method

Executed when mouse left button is up.
protected OnMouseLeftButtonUp ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs The data for the event.
return void

OnMouseMove() protected method

Executed when mouse moves.
protected OnMouseMove ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs The data for the event.
return void

OnOpened() protected method

This method is called every time a FloatingWindow is displayed.
protected OnOpened ( ) : void
return void

OnRestored() protected method

Raises the FloatingWindow.Restored event.
protected OnRestored ( EventArgs e ) : void
e System.EventArgs The event data.
return void

RestoreSizeAndPosition() public method

Restores the size and position stored in the IsolatedStorage on closing.
public RestoreSizeAndPosition ( ) : void
return void

RestoreWindow() public method

Restores window state, size and its position.
public RestoreWindow ( ) : void
return void

Show() public method

Opens the FloatingWindow in previously saved position or in the center of the FloatingWindowHost.
public Show ( ) : void
return void

Show() public method

Shows the window in the specified coordinates, relative to the window's Host.
public Show ( Point point ) : void
point Point Coordinates of the upper-left corner of the window.
return void

Show() public method

Shows a FloatingWindow at maximal size taking into account specified margins and current FloatingWindowHost size.
public Show ( Thickness margins ) : void
margins Thickness Window margins.
return void

Show() public method

Shows the window in the specified coordinates, relative to the window's Host.
public Show ( double x, double y ) : void
x double X-coordinate.
y double Y-coordinate.
return void

ShowModal() public method

Shows the window as a modal one.
public ShowModal ( ) : void
return void

Property Details

CloseButtonStyleProperty public_oe static_oe property

Identifies the FloatingWindow.CloseButtonStyleProperty dependency property.
public static DependencyProperty,System.Windows CloseButtonStyleProperty
return System.Windows.DependencyProperty

FlowDirectionProperty public_oe static_oe property

Identifies the FloatingWindow.FlowDirection dependency property.
public static DependencyProperty,System.Windows FlowDirectionProperty
return System.Windows.DependencyProperty

IconProperty public_oe static_oe property

Identifies the FloatingWindow.Icon dependency property.
public static DependencyProperty,System.Windows IconProperty
return System.Windows.DependencyProperty

IconTextProperty public_oe static_oe property

Identifies the FloatingWindow.IconText dependency property.
public static DependencyProperty,System.Windows IconTextProperty
return System.Windows.DependencyProperty

MaximizeButtonStyleProperty public_oe static_oe property

Identifies the FloatingWindow.MaximizeButtonStyleProperty dependency property.
public static DependencyProperty,System.Windows MaximizeButtonStyleProperty
return System.Windows.DependencyProperty

MinimizeButtonStyleProperty public_oe static_oe property

Identifies the FloatingWindow.MinimizeButtonStyleProperty dependency property.
public static DependencyProperty,System.Windows MinimizeButtonStyleProperty
return System.Windows.DependencyProperty

PositionProperty public_oe static_oe property

Identifies the FloatingWindow.Position dependency property.
public static DependencyProperty,System.Windows PositionProperty
return System.Windows.DependencyProperty

ResizeEnabledProperty public_oe static_oe property

Identifies the FloatingWindow.ResizeEnabled dependency property.
public static DependencyProperty,System.Windows ResizeEnabledProperty
return System.Windows.DependencyProperty

ResizingAreaThicknessProperty public_oe static_oe property

Identifies the FloatingWindow.ResizingAreaThickness dependency property.
public static DependencyProperty ResizingAreaThicknessProperty
return DependencyProperty

RestoreButtonStyleProperty public_oe static_oe property

Identifies the FloatingWindow.RestoreButtonStyleProperty dependency property.
public static DependencyProperty RestoreButtonStyleProperty
return DependencyProperty

ShowCloseButtonProperty public_oe static_oe property

Identifies the FloatingWindow.ShowCloseButton dependency property.
public static DependencyProperty ShowCloseButtonProperty
return DependencyProperty

ShowInIconbarProperty public_oe static_oe property

Identifies the FloatingWindow.ShowInIconbar dependency property.
public static DependencyProperty ShowInIconbarProperty
return DependencyProperty

ShowMaximizeButtonProperty public_oe static_oe property

Identifies the FloatingWindow.ShowMaximizeButton dependency property.
public static DependencyProperty ShowMaximizeButtonProperty
return DependencyProperty

ShowMinimizeButtonProperty public_oe static_oe property

Identifies the FloatingWindow.ShowMinimizeButton dependency property.
public static DependencyProperty ShowMinimizeButtonProperty
return DependencyProperty

ShowRestoreButtonProperty public_oe static_oe property

Identifies the FloatingWindow.ShowRestoreButton dependency property.
public static DependencyProperty ShowRestoreButtonProperty
return DependencyProperty

TitleBackgroundProperty public_oe static_oe property

Identifies the FloatingWindow.TitleBackground dependency property.
public static DependencyProperty TitleBackgroundProperty
return DependencyProperty

TitleProperty public_oe static_oe property

Identifies the FloatingWindow.Title dependency property.
public static DependencyProperty TitleProperty
return DependencyProperty

TitleStyleProperty public_oe static_oe property

Identifies the FloatingWindow.TitleStyleProperty dependency property.
public static DependencyProperty TitleStyleProperty
return DependencyProperty