Class PaddingConverter
Converts instances of other types to and from instances of Padding.
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class PaddingConverter : ThicknessConverter, IValueConverter
Methods
View SourceCanConvertFrom(ITypeDescriptorContext, Type)
Determines whether the type converter can create an instance of Thickness from a specified type.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext typeDescriptorContext, Type sourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeDescriptorContext | typeDescriptorContext | The context information of a type. |
| Type | sourceType | The source type that the type converter is evaluating for conversion. |
Returns
| Type | Description |
|---|---|
| bool | true if the type converter can create an instance of Thickness from the specified type; otherwise, false. |
Overrides
View SourceCanConvertTo(ITypeDescriptorContext, Type)
Determines whether the type converter can convert an instance of Thickness to a different type.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext typeDescriptorContext, Type destinationType)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeDescriptorContext | typeDescriptorContext | The context information of a type. |
| Type | destinationType | The type for which the type converter is evaluating this instance of Thickness for conversion. |
Returns
| Type | Description |
|---|---|
| bool | true if the type converter can convert this instance of Thickness to the |
Overrides
View SourceConvert(object, Type, object, CultureInfo)
Converts a value.
Declaration
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value produced by the binding source. |
| Type | targetType | The type of the binding target property. |
| object | parameter | The converter parameter to use. |
| CultureInfo | culture | The culture to use in the converter. |
Returns
| Type | Description |
|---|---|
| object | A converted value. If the method returns null, the valid null value is used. |
ConvertBack(object, Type, object, CultureInfo)
Converts a value.
Declaration
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The value that is produced by the binding target. |
| Type | targetType | The type to convert to. |
| object | parameter | The converter parameter to use. |
| CultureInfo | culture | The culture to use in the converter. |
Returns
| Type | Description |
|---|---|
| object | A converted value. If the method returns null, the valid null value is used. |
ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
Attempts to create an instance of Thickness from a specified object.
Declaration
public override object ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object source)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeDescriptorContext | typeDescriptorContext | The context information for a type. |
| CultureInfo | cultureInfo | The CultureInfo of the type being converted. |
| object | source | The |
Returns
| Type | Description |
|---|---|
| object | An instance of Thickness created from the converted |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The |
| ArgumentException | The example object is not a null reference and is not a valid type that can be converted to a Thickness. |
ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
Attempts to convert an instance of Thickness to a specified type.
Declaration
public override object ConvertTo(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, object value, Type destinationType)
Parameters
| Type | Name | Description |
|---|---|---|
| ITypeDescriptorContext | typeDescriptorContext | The context information of a type. |
| CultureInfo | cultureInfo | The CultureInfo of the type being converted. |
| object | value | The instance of Thickness to convert. |
| Type | destinationType | The type that this instance of Thickness is converted to. |
Returns
| Type | Description |
|---|---|
| object | The type that is created when the type converter converts an instance of Thickness. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The |
| ArgumentException | The |