RobDog888
RobDog888

Reputation: 239

WPF Change a label's display based upon a bound textbox contents change

I have a bound textbox and I need to change its associated display label to bold upon the presence of any content. I dont want to use javascript if at all possible.

Thanks

Upvotes: 3

Views: 810

Answers (1)

John Gardner
John Gardner

Reputation: 25146

Why would javascript be involved?

Anyway, if this is really wpf, bind the FontWeight property of your label to the textbox's text property, using custom converter that converts null/empty strings to Normal font weight, and non-null/non-empty to Bold.

Upvotes: 4

Related Questions