I see no way to do this with TargetNullValue. As a workaround, you can try using the converter:
public class NullValueConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { return value; } var resourceName = (string)parameter; return AppResources.ResourceManager.GetString(resourceName); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } }
Then add it to your page resources:
<phone:PhoneApplicationPage.Resources> <local:NullValueConverter x:Key="NullValueConverter" /> </phone:PhoneApplicationPage.Resources>
Finally, use TargetNullValue instead:
<TextBlock Text="{Binding DueDate, Converter={StaticResource NullValueConverter}, ConverterParameter=bt_help_Title1}" />
source share