I have a MainWindow with a ViewModel, when I press a button, a new SubWindow, with its onw ViewModel is opened, which recieves the "parent" ViewModel, like this:
private AppViewModel vm;
public void Show(AppViewModel vm)
{
this.vm = vm;
this.DialogShown = true;
}
When I close the SubWindow this method is called:
public void Hide()
{
vm.IsFocused = true;
this.DialogShown = false;
}
But in my MainWindow my TextBox doesn't get focused...
This is my property:
public bool IsFocused
{
get { return _isFocused; }
set
{
if (value != _isFocused)
{
_isFocused = value;
OnPropertyChanged("IsFocused");
}
}
}
And this is my xaml:
<TextBox Focusable="True" AcceptsReturn="True" ext:FocusExtension.IsFocused="{Binding IsFocused, Mode=TwoWay}" IsTabStop="False"/>
What am I doing wrong?