Support for multibinding in WPF and WIN8
What's the use of this, citing the MSDN example http://msdn.microsoft.com/en-us/library/system.windows.data.multibinding.aspx:
MultiBinding allows you to bind a binding target to a list of the source properties and then apply logic to produce a Value with the given inputs. This is example demonstrates how to use multibinding.
In the following example, Namelistdata refers to a collection of PersonName objects, which are-objects that contain two PR Operties, FirstName and LastName. The following example produces a TextBlock that shows the ' the ' and last names ' a person with the ' last name '.
<textblock name= "TextBox2" datacontext= "{StaticResource namelistdata}" > <TextBlock.Text> <multibinding converter= "{StaticResource mynameconverter}" converterparameter= "Formatlastfirst" > <binding path= "FirstName"/> <binding path= "LastName"/> </MULTIBINDING&G
T </TextBlock.Text> </textblock>
public class Nameconverter:imultivalueconverter
{Public
object Convert (object[] values, Type targettype, Object parameter, CultureInfo culture)
{
string name;
Switch ((string) parameter)
{case
"Formatlastfirst":
name = values[1] + "," + values[0];
break;
Case "Formatnormal":
default:
name = Values[0] + "" + values[1];
break;
return name;
Public object[] Convertback (object value, type[] targettypes, object parameter, CultureInfo culture)
{
string [] Splitvalues = ((string) value). Split (")";
Return splitvalues
}
}