3

This may be something simple I'm missing. Is it possible to set Button content to binding while still showing some default text in designer?

Ex. <Button Content="{Binding buttonContent}"/>

Binding works properly, but in designer the button content is just blank. We would like it to show some text like "Start" in designer.

Ecstokely
  • 41
  • 4

2 Answers2

5

Use a FallbackValue:

<Button Content="{Binding buttonContent, FallbackValue=Start}"/>
mm8
  • 163,881
  • 10
  • 57
  • 88
0

I believe what you are looking for is TargetNullValue.

For your example it would look like this:

<Button Content="{Binding buttonContent, TargetNullValue=Start}"/>

This link may be useful to you as well.

Sudsy1002
  • 588
  • 6
  • 21