I have a ShellViewModel
that is a conductor. It has a series of menu items that open various view/viewmodels that are "hosted" in a tab control, similar to the Simple MDI example found here Caliburn Micro Composition Documentation
Some of the view items should not be hosted inside the tab control, but rather need to be Non modal windows. I'm able to open them using the WindowManager's ShowWindow
method.
However, when these windows lose focus, they remain "on top" of the shell window.
ShellView.xaml
<Window x:Class="SimpleCaliburnWpf.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SimpleCaliburnWpf"
mc:Ignorable="d"
Title="ShellView" Height="300" Width="300">
<Grid>
<Button Name="OpenWindow">Open A New Window!</Button>
</Grid>
ShellViewModel.cs
public class ShellViewModel : Conductor<IScreen>.Collection.AllActive
{
private IWindowManager _windowManager;
public ShellViewModel(IWindowManager windowManager)
{
_windowManager = windowManager;
}
public void OpenWindow()
{
var vm = new FirstViewModel();
_windowManager.ShowWindow(vm);
}
}
FirstViewModel.cs
public class FirstViewModel : Screen { }
Could someone offer suggestions as to how these windows could live behind the shell if the shell is clicked on.
As you can see, ShellView
is activated, but FirstView
remains in front.