OpacityConverter.ConvertTo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts from the converter's native type to a value of the destination type.
public:
override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value, Type ^ destinationType);
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);
public override object? ConvertTo (System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, Type destinationType);
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj
Public Overrides Function ConvertTo (context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object
Parameters
- context
- ITypeDescriptorContext
A ITypeDescriptorContext that provides information about the context of a type converter.
- culture
- CultureInfo
The locale information for the conversion.
- value
- Object
The value to convert.
- destinationType
- Type
The type to convert the object to.
Returns
An Object that represents the converted value
.
Exceptions
destinationType
is null
.
value
cannot be converted to the destinationType
.
Remarks
The ConvertTo method is specialized to convert integral values to their String percentage representations. Other types are passed to the base class implementation of this method.
Notes to Inheritors
Override this method to provide your own conversion requirements.
You can use the context
parameter to extract additional information about the environment this converter is being invoked from. The parameter may be null
, so you should always verify the contents. Also, properties on the ITypeDescriptorContext may also return null
.
The resultant object is a String representing the percentage of opacity.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈