Is there a standard way to set a default or fallback value for a WPF binding if the bound string is empty?
You should create a converter for this, which implements IValueConverter
public class StringEmptyConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return string.IsNullOrEmpty((string)value) ? parameter : value;
}
public object ConvertBack(
object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
throw new NotSupportedException();
}
}
Then in xaml you'd just provide the converter to the binding, (xxx just represents your Window / UserControl / Style ... where the binding is)