Converts a single object to a ReadOnlyCollection containing that single object.
Especially useful for binding a TreeView's ItemsSource to a single root. May be used as a markup extension.
Public Member Functions |
|
object | Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
Convert a single object value to a
ReadOnlyCollection containing that object. |
|
object | ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
Convert an IEnumerable to its first object.
|
|
override object | ProvideValue (IServiceProvider serviceProvider) |
Implements the MarkupExtension interface to
return the shared Converter. |
|
Static Public Attributes |
|
static
readonly WrapWithCollectionConverter |
Converter = new WrapWithCollectionConverter() |
Common instance of this converter. |
object WPFCustomControls::Converters::WrapWithCollectionConverter::Convert | ( | object | value, |
Type | targetType, | ||
object | parameter, | ||
System.Globalization.CultureInfo | culture | ||
) | [inline] |
Convert a single object value to a ReadOnlyCollection containing that object.
value | Object to wrap in a ReadOnlyCollection |
targetType | Ignored. |
parameter | Ignored. |
culture | Ignored. |
object WPFCustomControls::Converters::WrapWithCollectionConverter::ConvertBack | ( | object | value, |
Type | targetType, | ||
object | parameter, | ||
System.Globalization.CultureInfo | culture | ||
) | [inline] |
Convert an IEnumerable to its first object.
value | ReadOnlyCollection to unwrap |
targetType | Ignored. |
parameter | Ignored. |
culture | Ignored. |
override object WPFCustomControls::Converters::WrapWithCollectionConverter::ProvideValue | ( | IServiceProvider | serviceProvider | ) | [inline] |
Implements the MarkupExtension interface to return the shared Converter.
serviceProvider | Not used. |
readonly
WrapWithCollectionConverter
WPFCustomControls::Converters::WrapWithCollectionConverter::Converter
= new
WrapWithCollectionConverter() [static] |
Common instance of this converter.
May be shared to reduce memory demands, and provided by the MarkupExtension.