Επεξεργασία

Κοινή χρήση μέσω


RoutedEventConverter.ConvertFrom Method

Definition

Attempts to convert the specified object to a RoutedEvent object, using the specified context.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, System::Globalization::CultureInfo ^ cultureInfo, System::Object ^ source);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, System.Globalization.CultureInfo cultureInfo, object source);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (typeDescriptorContext As ITypeDescriptorContext, cultureInfo As CultureInfo, source As Object) As Object

Parameters

typeDescriptorContext
ITypeDescriptorContext

A format context that provides information about the environment from which this converter is being invoked.

cultureInfo
CultureInfo

Culture specific information.

source
Object

The object to convert.

Returns

The conversion result.

Exceptions

source is not a string or cannot be converted.

Remarks

The RoutedEventConverter class only converts from String. Various techniques are employed in an attempt to obtain a result. typeDescriptorContext is checked for various services including IXamlTypeResolver, IXamlSchemaContextProvider, and IAmbientProvider. The provided string is also checked against the internal list of WPF registered routed events on FrameworkElement. If all these attempts fail to resolve, NotSupportedException is thrown.

Applies to