Reputation: 2071
Is there a way to fully prevent lostFocus from a TextBox?
I would like to prevent any action from app(button clicks, switching focus to other TextBoxes) until I meet some conditions
I have figured out how to prevent switching focus from a TextBox, but this does not help with button clicks/commands:
textBox.PreviewLostKeyboardFocus += (sender, args) =>
{
if(textBox.Text != "test")
args.Handled = true;
};
But right now: how to disallow clicking on Buttons? (perfectly - disallow everything until I meet specific conditions)
Upvotes: 0
Views: 600
Reputation: 526
Disable all your button by default. Then in your event, enable button by your conditions.
Upvotes: 1