Class NullableConverter<T>
Converts a string or base value to a System.Nullable value.
Inheritance
Namespace: System.Windows.Controls.DataVisualization.Charting
Assembly: Controls.DataVisualization.OpenSilver.dll
Syntax
public class NullableConverter<T> : TypeConverter where T : struct
Type Parameters
Name | Description |
---|---|
T | The type should be value type. |
Methods
| Improve this Doc View SourceCanConvertFrom(ITypeDescriptorContext, Type)
Returns whether the type converter can convert an object from the specified type to the type of this converter.
Declaration
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An object that provides a format context. |
System.Type | sourceType | The type you want to convert from. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if this converter can perform the conversion; otherwise, false. |
CanConvertTo(ITypeDescriptorContext, Type)
Returns whether the type converter can convert an object from the specified type to the type of this converter.
Declaration
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An object that provides a format context. |
System.Type | destinationType | The type you want to convert to. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if this converter can perform the conversion; otherwise, false. |
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)
Converts from the specified value to the type of this converter.
Declaration
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An object that provides a format context. |
System.Globalization.CultureInfo | culture | The System.Globalization.CultureInfo to use as the current culture. |
System.Object | value | The value to convert to the type of this converter. |
Returns
Type | Description |
---|---|
System.Object | The converted value. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The conversion cannot be performed. |
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)
Converts from the specified value to the a specified type from the type of this converter.
Declaration
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Parameters
Type | Name | Description |
---|---|---|
ITypeDescriptorContext | context | An object that provides a format context. |
System.Globalization.CultureInfo | culture | The System.Globalization.CultureInfo to use as the current culture. |
System.Object | value | The value to convert to the type of this converter. |
System.Type | destinationType | The type of convert the value to . |
Returns
Type | Description |
---|---|
System.Object | The converted value. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The conversion cannot be performed. |