Class FrameworkElementExtensions
Contains extension methods for the FrameworkElement class.
Inherited Members
Namespace: TheXDS.MCART.Helpers
Assembly: MCART.Wpf.Common.dll
Syntax
public static class FrameworkElementExtensions
Methods
| Edit this page View SourceBind(FrameworkElement, DependencyProperty, INotifyPropertyChanged)
Binds a dependency property on the element to a source that implements INotifyPropertyChanged.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty dp, INotifyPropertyChanged source)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | dp | Dependency property to bind. |
| INotifyPropertyChanged | source | Source implementing INotifyPropertyChanged. |
Bind(FrameworkElement, DependencyProperty, INotifyPropertyChanged, BindingMode)
Binds a dependency property on the element to a source that implements INotifyPropertyChanged, with the specified binding mode.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty dp, INotifyPropertyChanged source, BindingMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | dp | Dependency property to bind. |
| INotifyPropertyChanged | source | Source implementing INotifyPropertyChanged. |
| BindingMode | mode | Binding mode to use. |
Bind(FrameworkElement, DependencyProperty, INotifyPropertyChanged, DependencyProperty)
Binds the specified target dependency property to a source property on an object that implements INotifyPropertyChanged, using two-way binding.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty targetDp, INotifyPropertyChanged source, DependencyProperty sourceDp)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | targetDp | Target dependency property. |
| INotifyPropertyChanged | source | Source implementing INotifyPropertyChanged. |
| DependencyProperty | sourceDp | Source dependency property. |
Bind(FrameworkElement, DependencyProperty, INotifyPropertyChanged, DependencyProperty, BindingMode)
Binds the specified target dependency property to a source property on an object that implements INotifyPropertyChanged, using the specified mode.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty targetDp, INotifyPropertyChanged source, DependencyProperty sourceDp, BindingMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | targetDp | Target dependency property. |
| INotifyPropertyChanged | source | Source implementing INotifyPropertyChanged. |
| DependencyProperty | sourceDp | Source dependency property. |
| BindingMode | mode | Binding mode to use. |
Bind(FrameworkElement, DependencyProperty, object, DependencyProperty, BindingMode)
Binds a target dependency property on the element to a property on an arbitrary source object using the given binding mode.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty targetDp, object source, DependencyProperty sourceDp, BindingMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | targetDp | Target dependency property. |
| object | source | Binding source object. |
| DependencyProperty | sourceDp | Source dependency property. |
| BindingMode | mode | Binding mode to use. |
Bind(FrameworkElement, DependencyProperty, DependencyObject)
Binds a dependency property on the element to a source DependencyObject.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty dp, DependencyObject source)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | dp | Dependency property to bind. |
| DependencyObject | source | Binding source object. |
Bind(FrameworkElement, DependencyProperty, DependencyObject, BindingMode)
Binds a dependency property on the element to a source DependencyObject using the specified mode.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty dp, DependencyObject source, BindingMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | dp | Dependency property to bind. |
| DependencyObject | source | Binding source object. |
| BindingMode | mode | Binding mode to use. |
Bind(FrameworkElement, DependencyProperty, DependencyObject, DependencyProperty)
Binds the specified target dependency property to a source dependency property on a DependencyObject.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty targetDp, DependencyObject source, DependencyProperty sourceDp)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | targetDp | Target dependency property. |
| DependencyObject | source | Binding source object. |
| DependencyProperty | sourceDp | Source dependency property. |
Bind(FrameworkElement, DependencyProperty, DependencyObject, DependencyProperty, BindingMode)
Binds the specified target dependency property to a source dependency property on a DependencyObject, using the provided binding mode.
Declaration
public static void Bind(this FrameworkElement obj, DependencyProperty targetDp, DependencyObject source, DependencyProperty sourceDp, BindingMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | obj | Target element of the binding. |
| DependencyProperty | targetDp | Target dependency property. |
| DependencyObject | source | Binding source object. |
| DependencyProperty | sourceDp | Source dependency property. |
| BindingMode | mode | Binding mode to use. |
Render(FrameworkElement)
Creates a bitmap from a FrameworkElement.
Declaration
public static RenderTargetBitmap Render(this FrameworkElement f)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | f | The FrameworkElement to render. |
Returns
| Type | Description |
|---|---|
| RenderTargetBitmap | A RenderTargetBitmap containing a rendered image of
|
Render(FrameworkElement, int)
Creates a bitmap from a FrameworkElement, using the specified DPI value.
Declaration
public static RenderTargetBitmap Render(this FrameworkElement f, int dpi)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | f | The FrameworkElement to render. |
| int | dpi | Dots-per-inch value for the bitmap. |
Returns
| Type | Description |
|---|---|
| RenderTargetBitmap | A RenderTargetBitmap containing a rendered image of
|
Render(FrameworkElement, Size, Size, int)
Creates a bitmap of a FrameworkElement by setting the size at which the control will be drawn, so it does not need to be visible in the UI.
Declaration
public static RenderTargetBitmap Render(this FrameworkElement f, Size inSize, Size outSize, int dpi)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | f | The FrameworkElement to render. |
| Size | inSize | Size used to measure the control. |
| Size | outSize | Canvas size to render the control onto. |
| int | dpi | Dots-per-inch value for the bitmap. |
Returns
| Type | Description |
|---|---|
| RenderTargetBitmap | A RenderTargetBitmap containing a rendered image of
|