could anyone explain IvalueConverter interface and its method of convert() and convertback() and specially their arguments :object value, Type targetType, object parameter, string language code snippet:
<StackPanel Margin="30">
<TextBox Name="txtbox"/>
<TextBox Text="{Binding ElementName=txtbox,Path=Text,Converter={StaticResource RC_converter}}" FontSize="14" />
</StackPanel>
public object Convert(object value, Type targetType, object parameter, string language)
{
double pkr;
double dollar = 0.0;
if (double.TryParse(value.ToString(), out pkr))
{
dollar = pkr * 0.0099;
}
return dollar;
}
Secondly as above method gives me currency in dollar if I enter rupee amount in the text boxes. So what if I change the amount of dollar from second textbox? Do I need to use convertback for that purpose?