I have a binded TextBlock
, XAML:
<TextBlock Text="{Binding MyText}"/>
I know the FallbackValue
can be used if the Binding isn't available, but this happens at run time ? Is there any way to show a default value at design time ? It would make things easier if I could see a value when designing my windows instead of an empty TextBlock
.
Thanks
If you would prefer a less verbose version of Ian Bamforth's answer, you can just do
Adapting an example from this question.
This works for me - the text "None" is shown in the designer:
Hope that helps
If you have this data bound and are using the MVVM architecture then setting a DEFAULT value for the model item it is bound to will display the value at design time
I am just using:
Model.cs:
and in my XAML:
and the default value of "999999" is being displayed in the designer