title: Caliburn Micro: Screen.TryClose does not work
body: <p>I am running out of hair in frustration.</p>
  
  <p>I have made a somewhat minimal example where the same viewmodel/view acts as main window and dialog. Hope this does not cause confusion.</p>
  
  <pre><code>class DialogViewModel : Screen
  {
      private readonly IWindowManager _windowManager;
  
      public DialogViewModel(IWindowManager windowManager)
      {
          _windowManager = windowManager;
      }
  
      public void ShowDialog()
      {
          _windowManager.ShowDialog(new DialogViewModel(_windowManager));
      }
  
      //----------
  
      public DialogViewModel()
      {
  
      }
  
      public void Close()
      {
          TryClose();
          //TryClose(true);
          //TryClose(false);
      }
  }
  
  &lt;Window x:Class="Views.DialogView"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                  xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro.Platform"
                  mc:Ignorable="d" 
                  d:DesignHeight="100" d:DesignWidth="200"&gt;
      &lt;WrapPanel&gt;
          &lt;Button&gt;
              Close
              &lt;i:Interaction.Triggers&gt;
                  &lt;i:EventTrigger EventName="Click"&gt;
                      &lt;cal:ActionMessage MethodName="Close" /&gt;
                  &lt;/i:EventTrigger&gt;
              &lt;/i:Interaction.Triggers&gt;
          &lt;/Button&gt;
          &lt;Button&gt;
              Show Dialog
              &lt;i:Interaction.Triggers&gt;
                  &lt;i:EventTrigger EventName="Click"&gt;
                      &lt;cal:ActionMessage MethodName="ShowDialog" /&gt;
                  &lt;/i:EventTrigger&gt;
              &lt;/i:Interaction.Triggers&gt;
          &lt;/Button&gt;
      &lt;/WrapPanel&gt;
  &lt;/Window&gt;
  
  public sealed class AppBootstrapper : BootstrapperBase
  {
      private SimpleContainer _container;
  
      public AppBootstrapper() : base(true)
      {
          StartRuntime();
      }
  
      protected override void OnStartup(object sender, StartupEventArgs e)
      {
          DisplayRootViewFor&lt;DialogViewModel&gt;();
      }
  
      protected override void Configure()
      {
          _container = new SimpleContainer();
          _container.Singleton&lt;IWindowManager, WindowManager&gt;();
          _container.Singleton&lt;IEventAggregator, EventAggregator&gt;();
  
          _container.PerRequest&lt;DialogViewModel&gt;();
      }
  
      protected override object GetInstance(Type service, string key)
      {
          var instance = _container.GetInstance(service, key);
          if (instance != null)
              return instance;
          throw new InvalidOperationException("Could not locate any instances.");
      }
  
      protected override IEnumerable&lt;object&gt; GetAllInstances(Type service)
      {
          return _container.GetAllInstances(service);
      }
  
      protected override void BuildUp(object instance)
      {
          _container.BuildUp(instance);
      }
  }
  </code></pre>
  
  <p>The call TryClose() does not initiate OnDeactivate.
  According to <a href="https://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition" rel="nofollow">https://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition</a> and the several posts here on stackoverflow the above should be enough. But nothing happens when I call TryClose().</p>
  
  <p>Please note that code does run and show the dialogs on my machine. If something is missing, please let me know.</p>
  
  <p>Any ideas why?</p>
  
  <p>Thank you!</p>