I have a TextBox
and a Button
in my view.
Now I am checking a condition upon button click and if the condition turns out to be false, displ
After implementing the accepted answer I did run across an issue that when navigating views with Prism the TextBox would still not get focus. A minor change to the PropertyChanged handler resolved it
private static void OnIsFocusedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var uie = (UIElement)d;
if ((bool)e.NewValue)
{
uie.Dispatcher.BeginInvoke(DispatcherPriority.Input, new Action(() =>
{
uie.Focus();
}));
}
}