Is there a standard way to set a default or fallback value for a WPF binding if the bound string is empty?
<TextBlock Text="{Binding Name, FallbackValue='Unnamed'" />
The FallbackValue
only seems to kick in when Name
is null, but not when it is set to String.Empty
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…