C# Класс SilverFlow.Controls.Extensions.ControlExtensions

Useful WPF/Silverlight controls extensions
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
GetPropertyPathForTranslateTransform ( this element, string translateBy ) : PropertyPath

Gets a PropertyPath for the TranslateTransform property.

Описание методов

ContainsPoint() публичный статический Метод

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).
Результат bool

GetActualBoundingRectangle() публичный статический Метод

Gets the actual bounding rectangle of the FrameworkElement.
public static GetActualBoundingRectangle ( this element ) : Rect
element this The element.
Результат System.Windows.Rect

GetPropertyPathForTranslateTransformX() публичный статический Метод

Gets a PropertyPath for the TranslateTransform.X property.
public static GetPropertyPathForTranslateTransformX ( this element ) : PropertyPath
element this The element.
Результат System.Windows.PropertyPath

GetPropertyPathForTranslateTransformY() публичный статический Метод

Gets a PropertyPath for the TranslateTransform.Y property.
public static GetPropertyPathForTranslateTransformY ( this element ) : PropertyPath
element this The element.
Результат System.Windows.PropertyPath

GetRelativePosition() публичный статический Метод

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.
Результат Point

GetScaleFactorToFit() публичный статический Метод

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.
Результат double

Horizontal() публичный статический Метод

Gets total horizontal value of the specified thickness.
Input parameter is null.
public static Horizontal ( this thickness ) : double
thickness this The thickness.
Результат double

IsFocused() публичный статический Метод

public static IsFocused ( this control ) : bool
control this
Результат bool

IsVisible() публичный статический Метод

Determines whether the specified UI element is visible.
public static IsVisible ( this uiElement ) : bool
uiElement this The UI element.
Результат bool

IsVisualAncestorOf() публичный статический Метод

public static IsVisualAncestorOf ( this element, DependencyObject descendent ) : bool
element this
descendent System.Windows.DependencyObject
Результат bool

IsVisualDescendentOf() публичный статический Метод

public static IsVisualDescendentOf ( this element, DependencyObject ancestor ) : bool
element this
ancestor System.Windows.DependencyObject
Результат bool

MoveToContainer() публичный статический Метод

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.
Результат void

RemoveFromContainer() публичный статический Метод

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.
Результат void

SetVisible() публичный статический Метод

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.
Результат void

Vertical() публичный статический Метод

Gets total vertical value of the specified thickness.
Input parameter is null.
public static Vertical ( this thickness ) : double
thickness this The thickness.
Результат double