C# Class Yuhan.WPF.Controls.AdornedControl

A content control that allows an adorner for the content to be defined in XAML.
Inheritance: System.Windows.Controls.ContentControl
Datei anzeigen Open project: hansuky/Yuhan Class Usage Examples

Public Properties

Property Type Description
AdornedTemplatePartNameProperty System.Windows.DependencyProperty
AdornerContentProperty System.Windows.DependencyProperty
AdornerOffsetXProperty System.Windows.DependencyProperty
AdornerOffsetYProperty System.Windows.DependencyProperty
CloseAdornerTimeOutProperty System.Windows.DependencyProperty
FadeInAdornerCommand System.Windows.Input.RoutedCommand
FadeInTimeProperty System.Windows.DependencyProperty
FadeOutAdornerCommand System.Windows.Input.RoutedCommand
FadeOutTimeProperty System.Windows.DependencyProperty
HideAdornerCommand System.Windows.Input.RoutedCommand
HorizontalAdornerPlacementProperty System.Windows.DependencyProperty
IsAdornerVisibleProperty System.Windows.DependencyProperty
IsMouseOverShowEnabledProperty System.Windows.DependencyProperty
ShowAdornerCommand System.Windows.Input.RoutedCommand
VerticalAdornerPlacementProperty System.Windows.DependencyProperty

Public Methods

Method Description
FadeInAdorner ( ) : void

Fade the adorner in and make it visible.

FadeOutAdorner ( ) : void

Fade the adorner out and make it visible.

FindNamedChild ( FrameworkElement rootElement, string childName ) : FrameworkElement

Finds a child element in the visual tree that has the specified name. Returns null if no child with that name exists.

HideAdorner ( ) : void

Hide the adorner.

OnApplyTemplate ( ) : void

Called to build the visual tree.

ShowAdorner ( ) : void

Show the adorner.

Protected Methods

Method Description
OnMouseEnter ( System.Windows.Input.MouseEventArgs e ) : void

Called when the mouse cursor enters the area of the adorned control.

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

Called when the mouse cursor leaves the area of the adorned control.

Private Methods

Method Description
AdornedControl ( ) : System

Static constructor to register command bindings.

AdornedControl_DataContextChanged ( object sender, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Event raised when the DataContext of the adorned control changes.

AdornerContent_PropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Event raised when the value of AdornerContent has changed.

CloseAdornerTimeOut_PropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Event raised when the CloseAdornerTimeOut property has change.

FadeInAdornerCommand_Executed ( object target, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Event raised when the FadeIn command is executed.

FadeOutAdornerCommand_Executed ( object target, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Event raised when the FadeOut command is executed.

HideAdornerCommand_Executed ( object target, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Event raised when the Hide command is executed.

HideAdornerInternal ( ) : void

Internal method to hide the adorner.

IsAdornerVisible_PropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Event raised when the value of IsAdornerVisible has changed.

IsMouseOverShowEnabled_PropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Event raised when the IsMouseOverShowEnabled property has changed.

MouseEnterLogic ( ) : void

Shared mouse enter code.

MouseLeaveLogic ( ) : void

Shared mouse leave code.

ShowAdornerCommand_Executed ( object target, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Event raised when the Show command is executed.

ShowAdornerInternal ( ) : void

Internal method to show the adorner.

ShowOrHideAdornerInternal ( ) : void

Internal method to show or hide the adorner based on the value of IsAdornerVisible.

UpdateAdornerDataContext ( ) : void

Update the DataContext of the adorner from the adorned control.

adornerContent_MouseEnter ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Event raised when the mouse cursor enters the area of the adorner.

adornerContent_MouseLeave ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Event raised when the mouse cursor leaves the area of the adorner.

closeAdornerTimer_Tick ( object sender, EventArgs e ) : void

Called when the close adorner time-out has ellapsed, the mouse has moved away from the adorned control and the adorner and it is time to close the adorner.

fadeInAnimation_Completed ( object sender, EventArgs e ) : void

Event raised when the fade in animation has completed.

fadeOutAnimation_Completed ( object sender, EventArgs e ) : void

Event raised when the fade-out animation has completed.

Method Details

FadeInAdorner() public method

Fade the adorner in and make it visible.
public FadeInAdorner ( ) : void
return void

FadeOutAdorner() public method

Fade the adorner out and make it visible.
public FadeOutAdorner ( ) : void
return void

FindNamedChild() public static method

Finds a child element in the visual tree that has the specified name. Returns null if no child with that name exists.
public static FindNamedChild ( FrameworkElement rootElement, string childName ) : FrameworkElement
rootElement System.Windows.FrameworkElement
childName string
return System.Windows.FrameworkElement

HideAdorner() public method

Hide the adorner.
public HideAdorner ( ) : void
return void

OnApplyTemplate() public method

Called to build the visual tree.
public OnApplyTemplate ( ) : void
return void

OnMouseEnter() protected method

Called when the mouse cursor enters the area of the adorned control.
protected OnMouseEnter ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs
return void

OnMouseLeave() protected method

Called when the mouse cursor leaves the area of the adorned control.
protected OnMouseLeave ( System.Windows.Input.MouseEventArgs e ) : void
e System.Windows.Input.MouseEventArgs
return void

ShowAdorner() public method

Show the adorner.
public ShowAdorner ( ) : void
return void

Property Details

AdornedTemplatePartNameProperty public_oe static_oe property

public static DependencyProperty,System.Windows AdornedTemplatePartNameProperty
return System.Windows.DependencyProperty

AdornerContentProperty public_oe static_oe property

public static DependencyProperty,System.Windows AdornerContentProperty
return System.Windows.DependencyProperty

AdornerOffsetXProperty public_oe static_oe property

public static DependencyProperty,System.Windows AdornerOffsetXProperty
return System.Windows.DependencyProperty

AdornerOffsetYProperty public_oe static_oe property

public static DependencyProperty,System.Windows AdornerOffsetYProperty
return System.Windows.DependencyProperty

CloseAdornerTimeOutProperty public_oe static_oe property

public static DependencyProperty,System.Windows CloseAdornerTimeOutProperty
return System.Windows.DependencyProperty

FadeInAdornerCommand public_oe static_oe property

public static RoutedCommand,System.Windows.Input FadeInAdornerCommand
return System.Windows.Input.RoutedCommand

FadeInTimeProperty public_oe static_oe property

public static DependencyProperty,System.Windows FadeInTimeProperty
return System.Windows.DependencyProperty

FadeOutAdornerCommand public_oe static_oe property

public static RoutedCommand,System.Windows.Input FadeOutAdornerCommand
return System.Windows.Input.RoutedCommand

FadeOutTimeProperty public_oe static_oe property

public static DependencyProperty,System.Windows FadeOutTimeProperty
return System.Windows.DependencyProperty

HideAdornerCommand public_oe static_oe property

public static RoutedCommand,System.Windows.Input HideAdornerCommand
return System.Windows.Input.RoutedCommand

HorizontalAdornerPlacementProperty public_oe static_oe property

public static DependencyProperty,System.Windows HorizontalAdornerPlacementProperty
return System.Windows.DependencyProperty

IsAdornerVisibleProperty public_oe static_oe property

Dependency properties.
public static DependencyProperty,System.Windows IsAdornerVisibleProperty
return System.Windows.DependencyProperty

IsMouseOverShowEnabledProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsMouseOverShowEnabledProperty
return System.Windows.DependencyProperty

ShowAdornerCommand public_oe static_oe property

Commands.
public static RoutedCommand,System.Windows.Input ShowAdornerCommand
return System.Windows.Input.RoutedCommand

VerticalAdornerPlacementProperty public_oe static_oe property

public static DependencyProperty,System.Windows VerticalAdornerPlacementProperty
return System.Windows.DependencyProperty