I'm using ImultiValueConverter and i want to convert two double values from two textboxes to double and multiply them and show the result in the third textbox this is the code in the .cs file
public class NE_charp_converter:IMultiValueConverter
{
public object Convert(object[] values,
Type targetType,
object parameter,
System.Globalization.CultureInfo culture)
{
double RE_sharp = double.Parse ((string)values[0]) +
double.Parse((string)values[1]) ;
return RE_sharp.ToString();
}
public object[] ConvertBack(object value, Type[] targetTypes,
object parameter,
System.Globalization.CultureInfo culture)
{
return null;
}
}
and this is the xaml code here:
<TextBox x:Name="NE_charp_txt" Height="77" Margin="0,151,37,0"
VerticalAlignment="Top" HorizontalAlignment="Right"
Width="51.615" BorderBrush="Black">
<TextBox.Text>
<MultiBinding Converter="{StaticResource NE_CONVERTER}" Mode="OneWay">
<Binding ElementName="WBC_txt" Path="Text"/>
<Binding ElementName="NE_percent_txt" Path="Text"/>
</MultiBinding>
</TextBox.Text>
</TextBox>
BUT I got this message: make sure your method arguments are in the right format
what is the right form to convert the object to double and return this value?!!