I have got this on my Xaml , I am passing value allocated to change gridcell colour. But I want to check also at same time Entered variable value so I can change according to that.How can I pass 2 values so I can have conditions on my iconverter class.
<DataGridTextColumn Binding="{Binding Allocated}" Header="Allocated" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background" Value="{Binding Allocated, Converter={StaticResource converter}}"/>
</Style>
</DataGridTextColumn.ElementStyle> </DataGridTextColumn>
my Converter class:
object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture){
string input = value.ToString();
switch (input)
{
case "99":
return Brushes.Green;
case "96":
return Brushes.Green;
case "91":
default:
return DependencyProperty.UnsetValue;
}
}
Blockquote
Thanks in advance!
Use
MultiBinding:and ake your convet implement
IMultiValueConverter: