FrameworkElementExtensions Class
Provides extension methods for the type FrameworkElement.
public static class FrameworkElementExtensions
- Inheritance:
- object object
Methods
AnimateDoubleProperty(FrameworkElement, string, double, double, double, double?, double?)
Animates a Double
-based property to a value.
public static void AnimateDoubleProperty(this FrameworkElement element, string propertyPath, double targetValue, double duration = 0.2, double startTime = 0, double? finalValue = null, double? initialValue = null)
Parameter | Type | Description |
---|---|---|
element | FrameworkElement | The FrameworkElement to examine. |
propertyPath | string | The property path. |
targetValue | double | The target value. |
duration | double | The duration. |
startTime | double | The start time. |
finalValue | double? | The optional final value. |
initialValue | double? | The optional initial value. |
BindToProperty(FrameworkElement, DependencyProperty, object, string, BindingMode, IValueConverter, object)
Binds a dependency property to a property on the specified source.
public static void BindToProperty(this FrameworkElement element, DependencyProperty targetProperty, object source, string sourcePropertyName, BindingMode mode, IValueConverter converter = null, object converterParameter = null)
Parameter | Type | Description |
---|---|---|
element | FrameworkElement | The target element. |
targetProperty | DependencyProperty | The target property. |
source | object | The source object. |
sourcePropertyName | string | The source property name. |
mode | BindingMode | The binding mode. |
converter | IValueConverter | The value converter. |
converterParameter | object | The value converter parameter. |
BindToProperty(FrameworkElement, DependencyProperty, object, DependencyProperty, BindingMode, IValueConverter, object)
Binds a dependency property to a property on the specified source.
public static void BindToProperty(this FrameworkElement element, DependencyProperty targetProperty, object source, DependencyProperty sourceProperty, BindingMode mode, IValueConverter converter = null, object converterParameter = null)
Parameter | Type | Description |
---|---|---|
element | FrameworkElement | The target element. |
targetProperty | DependencyProperty | The target property. |
source | object | The source object. |
sourceProperty | DependencyProperty | The source property. |
mode | BindingMode | The binding mode. |
converter | IValueConverter | The value converter. |
converterParameter | object | The value converter parameter. |
GetCurrentSize(FrameworkElement)
Returns the element's current size.
public static Size GetCurrentSize(this FrameworkElement element)
Parameter | Type | Description |
---|---|---|
element | FrameworkElement | The element to examine. |
Returns
- Size:
The element's current size.
Remarks
This method looks at the ActualWidth and ActualHeight properties for the size. If those haven't yet been set, the Width and Height properties are examined.