Binding.ConverterParameter property

Applies to Windows and Windows Phone

Gets or sets a parameter that can be used in the Converter logic.

Syntax


public:
property Object^ ConverterParameter { 
   Object^ get();
   void set (Object^ value);
}


<Binding ConverterParameter="parameter"/>
-or-
<Binding ConverterParameter="parameterReference"/>

XAML Values

parameter

A parameter value that is either a primitive value, or can be type converted from a string.

parameterReference

A parameter value that is obtained as a reference to an already existing object. Typically the object is created in a ResourceDictionary and given a key, then referenced by using the StaticResource markup extension.

Property value

Type: System.Object [.NET] | Platform::Object [C++]

A parameter to be passed to the Converter. This can be used in the conversion logic. The default is null.

Remarks

Passing parameters to a converter is a relatively advanced and uncommon scenarios. Most converters used for data binding simply type-convert a source object to a desired target type based solely on the characteristics of the source object, and knowing what the intended destination type is for a particular binding scenario.

If a value for ConverterParameter is specified, this value is used for the parameter value when invoking the converter logic. Specifically, this provides the value of the parameter parameter of the Convert or ConvertBack methods of the specific converter that is requested with the Converter property.

You can't set the property values of a Binding object after that binding has been attached to a target element and target property. If you attempt this you'll get a run-time exception.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Data
Windows::UI::Xaml::Data [C++]

Metadata

Windows.winmd

See also

Binding
Converter
XAML data binding sample
Data binding overview

 

 

Show:
© 2014 Microsoft