XamlMember.TypeConverter Property
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.
Gets a XamlValueConverter<TConverterBase> object, which can be used for type conversion construction of XAML declared objects.
public:
property System::Xaml::Schema::XamlValueConverter<System::ComponentModel::TypeConverter ^> ^ TypeConverter { System::Xaml::Schema::XamlValueConverter<System::ComponentModel::TypeConverter ^> ^ get(); };
public System.Xaml.Schema.XamlValueConverter<System.ComponentModel.TypeConverter> TypeConverter { get; }
member this.TypeConverter : System.Xaml.Schema.XamlValueConverter<System.ComponentModel.TypeConverter>
Public ReadOnly Property TypeConverter As XamlValueConverter(Of TypeConverter)
Property Value
A XamlValueConverter<TConverterBase> value, with a TypeConverter constraint on the generic.
Remarks
Calling TypeConverter invokes LookupTypeConverter or a specific override of that method. This behavior occurs when the initial internal reflection logic has not already set the information.
Implementations that return a non-null property value for TypeConverter are not necessarily a working TypeConverter. The following is a list of possible non-null return values for TypeConverter and what these values represent:
The return value reports a type converter that is attributed specifically to that member or more generally to the target type of the converter. This behavior is typically what most XAML type systems and XAML processors look for in order to instantiate a type converter and invoke its methods.
The return value reports a built-in value converter. These converters exist for certain internal operations that are performed by a XAML writer. In particular, these built-in value converters convert the raw attribute string values to the XAML language-level primitives. For the .NET Framework XAML Services implementation, these built-in type conversions often forward to a type converter that is defined in the System assembly. For example, a conversion for an Int32 value has built-in forwarded conversion, and therefore, the ConverterType value references Int32Converter.
The return value reports the special case of an unconstrained object model; that is, the XamlMember has a Type value of Object. In this case, the XamlValueConverter<TConverterBase> reports that the XamlValueConverter<TConverterBase>.Name is {
Object}
. However, ConverterInstance isnull
because no actual type or instance is available to perform this conversion. Instead, the object model behavior cannot be determined until run time, when the runtime of the specific technology determines the handling of its object graph.
If you can access a working TypeConverter from ConverterInstance, you can invoke its conversion methods. However, many conversion methods rely on service context. If you do not have the same service context available that the type converter expects for its typical role of writing objects for object graphs, the converter methods can throw exceptions.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기