Wouldn't the behavior you want be achieved by setting the Owner property instead of setting the Topmost property for sub-window?
public partial class MainWindow : Window
{
public MainWindow()
{
//InitializeComponent();
this.Title = "MainWindow";
this.Width = 400;
this.Height = 400;
this.Background = Brushes.LimeGreen;
this.ShowInTaskbar = true;
this.Loaded += MainWindow_Loaded;
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
Window subWindow = new Window();
subWindow.Title = "SubWindow";
subWindow.Width =300;
subWindow.Height = 100;
subWindow.Background = Brushes.Yellow;
subWindow.ShowInTaskbar = false;
//subWindow.Topmost = true; // not set Topmost
subWindow.Owner = this; // set owner
subWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
subWindow.Show();
}
}