Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Binding to Text but change Text when lost focus (watermark)?

$
0
0

Not sure how to pull this off with MVVM. I can bind a textbox to an objects property but additionally, I want to be able to set a text to the textbox when it loses focus (put a Search content). Typing in the textbox filters the collection view. How do I do about it from the ViewModel?

See attached image for the textbox:

I could try the solution posted here but my worry is that setting the Text in XAML would still trigger the filtering in my code (upon typing it searches a list).

http://stackoverflow.com/questions/3028494/focus-dependent-text-change-for-textboxes-in-wpf



Viewing all articles
Browse latest Browse all 18858

Trending Articles