CloseStrategy called multiple times.

Topics: Getting Started
Sep 27, 2012 at 8:54 AM

First, I am very new to Caliburn.Micro.

I am trying to set up a framework for WPF based on the MediaOwl example.

The problem is that I have fairly complex CanClose routines on some of my ViewModels and when I want to shut down the application, dialogs were coming multiple times. I have reduced the complexity and can see that the CloseStrategy Execute method is being called three times. I have no idea where to start looking for the problem.

The structure of the system is as follows. A shell with a containing a single Conductor<IDialog>.Collection.OneActive Viewmodel with "workspaces" (also a Conductor<IDialog>.Collection.OneActive ViewModel) containing "workitems". 

Even with absolutely no elements in the top Conductor<IDialog>.Collection.OneActive Viewmodel the CloseStrategy is being called three times. (The only active ViewModels are the ShellViewModel and the top level MainViewModel.) This behavior (CloseStrategy called three times) remains the same no matter how many ViewModels I have open. I feel like Caliburn is trying to summon a Close ghost from a mirror.

Any ideas where to go hunting for the problem? Should I try caching some kind of “CloseLevel” in my ViewModels to work around the problem?


Sep 28, 2012 at 2:52 PM

What Caliburn.Micro version you are using?

There were some fixes in the latest sources:


Please retry with the latest sources of Caliburn.Micro...

Oct 2, 2012 at 9:02 AM

Thanks for the tip. Sorry for the late reply.

I am using the NuGet package (

It turns out that wasn't the problem. I had followed the bootstrapper from the HelloScreens sample including the window close logic added in the bootstrapper. That was causing an addition call to closing. By adding a non-default close strategy to one of my screens caused a second call. 

By removing both of those, closing works as expected.