I have a textbox with default text like “Enter Name”
Once user starts typing some text or focuses on the textbox (with MouseEnter or KeyboardFocus), i want the default text to go and only user input to show.
But if user leaves it blank without any input and then MouseLeave or LostKeyboardFocus, I want the default text to reappear.
I think it is the simplest of pattern I am trying to implement, but not quite getting there.
How can i handle it in elegant standard way ? Do i need to be using custom variables to keep track of state amongst this event flow or WPF textbox events will suffice ?
Pseudo-code Example to do so will be great.
Some pseudo-code here: