<TextBlock Text=”{Binding Path=PhoneNumber, Converter={StaticResource PhoneFormatConverter}}”>
You need to ensure that phone numbers are displayed in the following format : (###) ### – ###
Which markup segment should you use ?
A.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return String.format(“{0:((###) ### – ###)}”, (long)parameter);
}
B.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return String.format(“{0:((###) ### – ###)}”, (long)value);
}
C.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return String.format(“{0:((###) ### – ###)}”, (long)parameter);
}
D.
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return String.format(“{0:((###) ### – ###)}”, (long)value);
}
Explanation:
A or B