UriConverter Class
Represents a value converter that returns a new System.Uri instance created using the specified URI string combined with an optional URI prefix.
[ValueConversion(typeof(string), typeof(Uri))]
public class UriConverter : DependencyObject
- Inheritance:
- object object
Remarks
This converter expects the source value to be a string which, when combined with the UriPrefix, can be used to create a new System.Uri instance.
Constructors
UriConverter()
Initializes an instance of the class.
public UriConverter()
Properties
UriPrefix
Gets or sets the URI prefix that should be prepended to all values converted by this object. This is a dependency property.
Methods
Convert(object, Type, object, CultureInfo)
Converts the specified URI, in the form of a string to a System.Uri.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
value | object | The value produced by the binding source. |
targetType | Type | The type of the binding target property. |
parameter | object | The converter parameter to use. |
culture | CultureInfo | The culture to use in the converter. |
Returns
- object:
A System.Uri associated with the specified URI string.
Remarks
See UriConverter for more information on the expected source values.
ConvertBack(object, Type, object, CultureInfo)
This method always returns null
and should not be used.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
value | object | Not used. |
targetType | Type | Not used. |
parameter | object | Not used. |
culture | CultureInfo | Not used. |
Returns
- object:
null
.
Fields
UriPrefixProperty
Identifies the UriPrefix dependency property. This field is read-only.
public static readonly DependencyProperty UriPrefixProperty