Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Button content with data binding WPF

Tags:

c#

button

wpf

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.

like image 322
Ecstokely Avatar asked Dec 06 '25 13:12

Ecstokely


1 Answers

Use a FallbackValue:

<Button Content="{Binding buttonContent, FallbackValue=Start}"/>
like image 165
mm8 Avatar answered Dec 08 '25 17:12

mm8



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!