Home > Net >  Converter Convert problem
Converter Convert problem

Time:09-20

I now have an array, I need according to the data in the array is converted into many bool Type,
 public object Convert (object value, Type targetType, object parameter, System. Globalization, CultureInfo culture) 
{
List The list=value as List;
Temparr=list;
Int rightid=int. Parse (parameter. The ToString ());
for (int i=0; i {
If (rightid==int. Parse (the list [I] the ToString ()))
{
return true;
}
}
return false;

} because it is a two-way binding, so I have to write convertback, don't know how to implement

CodePudding user response:

The Contains???????

CodePudding user response:

You refers to realize IValueConverter interface converter
The Convert method is to take the backstage data conversion interface, according to your logic write duck
  •  Tags:  
  • C#
  • Related