C# Class SilverFlow.Controls.Extensions.ControlExtensions

Useful WPF/Silverlight controls extensions
Afficher le fichier Open project: Zoomicon/ZUI

Méthodes publiques

Méthode Description
ContainsPoint ( this element, Point point, UIElement origin = null ) : bool

Determines whether the specified element contains the point.

GetActualBoundingRectangle ( this element ) : Rect

Gets the actual bounding rectangle of the FrameworkElement.

GetPropertyPathForTranslateTransformX ( this element ) : PropertyPath

Gets a PropertyPath for the TranslateTransform.X property.

GetPropertyPathForTranslateTransformY ( this element ) : PropertyPath

Gets a PropertyPath for the TranslateTransform.Y property.

GetRelativePosition ( this element, UIElement rootElement ) : Point

Gets position of the element relative to another specified (root) element.

GetScaleFactorToFit ( this element, double maxWidth, double maxHeight ) : double

Gets scale factor to fit the element to the specified size.

Horizontal ( this thickness ) : double

Gets total horizontal value of the specified thickness.

IsFocused ( this control ) : bool
IsVisible ( this uiElement ) : bool

Determines whether the specified UI element is visible.

IsVisualAncestorOf ( this element, DependencyObject descendent ) : bool
IsVisualDescendentOf ( this element, DependencyObject ancestor ) : bool
MoveToContainer ( this element, FrameworkElement newContainer ) : void

Moves the element to the new container. The container can be a Panel or a Decorator (Border in Silverlight) derived class.

RemoveFromContainer ( this element ) : void

Removes the element from its container. The container can be a Panel or a Decorator (Border in Silverlight) derived class.

SetVisible ( this uiElement, bool visible = true ) : void

Sets the visible of the UIElement.

Vertical ( this thickness ) : double

Gets total vertical value of the specified thickness.

Private Methods

Méthode Description
GetPropertyPathForTranslateTransform ( this element, string translateBy ) : PropertyPath

Gets a PropertyPath for the TranslateTransform property.

Method Details

ContainsPoint() public static méthode

Determines whether the specified element contains the point.
public static ContainsPoint ( this element, Point point, UIElement origin = null ) : bool
element this This FrameworkElement.
point Point The point to check.
origin UIElement Relative origin (optional).
Résultat bool

GetActualBoundingRectangle() public static méthode

Gets the actual bounding rectangle of the FrameworkElement.
public static GetActualBoundingRectangle ( this element ) : Rect
element this The element.
Résultat System.Windows.Rect

GetPropertyPathForTranslateTransformX() public static méthode

Gets a PropertyPath for the TranslateTransform.X property.
public static GetPropertyPathForTranslateTransformX ( this element ) : PropertyPath
element this The element.
Résultat System.Windows.PropertyPath

GetPropertyPathForTranslateTransformY() public static méthode

Gets a PropertyPath for the TranslateTransform.Y property.
public static GetPropertyPathForTranslateTransformY ( this element ) : PropertyPath
element this The element.
Résultat System.Windows.PropertyPath

GetRelativePosition() public static méthode

Gets position of the element relative to another specified (root) element.
Input parameter is null.
public static GetRelativePosition ( this element, UIElement rootElement ) : Point
element this The element.
rootElement UIElement The root element.
Résultat Point

GetScaleFactorToFit() public static méthode

Gets scale factor to fit the element to the specified size.
public static GetScaleFactorToFit ( this element, double maxWidth, double maxHeight ) : double
element this The element to scale.
maxWidth double Maximal width of the element.
maxHeight double Maximal height of the element.
Résultat double

Horizontal() public static méthode

Gets total horizontal value of the specified thickness.
Input parameter is null.
public static Horizontal ( this thickness ) : double
thickness this The thickness.
Résultat double

IsFocused() public static méthode

public static IsFocused ( this control ) : bool
control this
Résultat bool

IsVisible() public static méthode

Determines whether the specified UI element is visible.
public static IsVisible ( this uiElement ) : bool
uiElement this The UI element.
Résultat bool

IsVisualAncestorOf() public static méthode

public static IsVisualAncestorOf ( this element, DependencyObject descendent ) : bool
element this
descendent System.Windows.DependencyObject
Résultat bool

IsVisualDescendentOf() public static méthode

public static IsVisualDescendentOf ( this element, DependencyObject ancestor ) : bool
element this
ancestor System.Windows.DependencyObject
Résultat bool

MoveToContainer() public static méthode

Moves the element to the new container. The container can be a Panel or a Decorator (Border in Silverlight) derived class.
New Container is null.
public static MoveToContainer ( this element, FrameworkElement newContainer ) : void
element this The element.
newContainer System.Windows.FrameworkElement The new container of the element.
Résultat void

RemoveFromContainer() public static méthode

Removes the element from its container. The container can be a Panel or a Decorator (Border in Silverlight) derived class.
public static RemoveFromContainer ( this element ) : void
element this The element.
Résultat void

SetVisible() public static méthode

Sets the visible of the UIElement.
public static SetVisible ( this uiElement, bool visible = true ) : void
uiElement this The UI element.
visible bool Set Visible if true; otherwise - Collapsed.
Résultat void

Vertical() public static méthode

Gets total vertical value of the specified thickness.
Input parameter is null.
public static Vertical ( this thickness ) : double
thickness this The thickness.
Résultat double