This project is read-only.

FabTab with Caliburn Micro

Sep 29, 2010 at 4:12 PM

Moving the discussion of FabTab with Caliburn.Micro to here instead of the Caliburn.Micro forums.  Original discussion can be found here:

Sep 29, 2010 at 4:14 PM


Any chance I can get you to zip a sample solution that in a simplified way demonstrates the issue you are seeing?



Sep 29, 2010 at 4:29 PM

I will see If I can put one together.

Sep 29, 2010 at 8:19 PM

The initial problem was with the template.  However; there is still an additional problem with the application.  If you add more than one tabpage you get the following error:

The value "FabTab.ContentTabView" is not of type "Caliburn.Micro.IScreen" and cannot be used in this generic collection. 

You can get the sample project from here:


Sep 29, 2010 at 8:31 PM

Awesome, I'm looking at it now.

Sep 29, 2010 at 8:42 PM

Hey adfreeman,

Not sure exactly what particular FabTab functionality you are looking for in your app, but if you set ShowContentsTab="False" on the FabTabControl you declare in your ShellView.xaml then it all works beautifully.

Of course you won't have the ContentTabView then.  The problem I am seeing makes perfect sense--you're correctly trying to bind the ItemsSource of FabTab to a BindableCollection<IScreen> off of the Conductor, but then when I try to "trick" FabTab into adding the ContentTabView in behind the scenes we get that Exception because ContentTabView doesn't implement IScreen and can't be added to the Collection.

There's a number of ways to solve this.  One would be for me to somehow allow the FabTabConsumer to create their own sort of ContentTabView which could then be made to implement whatever interfaces are necessary.  I suspect that would be fairly involved. You'll notice that anywhere in the FabTab Sample project where I use the ItemsSource to populate the control I bind to ObservableCollection<object>;  That allows me to add in ContentTabView behind the scenes and have it work. But that's not a great solution is it?  let me think about that

Another would be for you to modify the FabTab source to make ContentTabView implement IScreen...that's the beauty of open source, you have the ability to create your own version of FabTab which references Caliburn Micro and does what you need.

I'll keep you posted on my thoughts about this as  I poke around.  Let me know if you have any ideas or whether you even care about the ContentTab functionality.



Sep 29, 2010 at 8:53 PM

Another thing which I tried was changing your ShellViewModel to subclass Conductor<DependencyObject> and then change your TabPageViewModel to subclass DependencyObject also.  Since ContentTabView also descends from DO, we get past our typing issues.

However, when I do that and click on the Content Tab instead of showing the ContentTabView as I would expect, I see "FabTab.ContentTabView not found" because Caliburn is, I think trying to use its conventions to find a view that matches what it thinks is a ViewModel in ContentTabView. Hmmm....I wonder if Caliburn Micro has a way to ignore it's convention if it fails to resolve a view and just attempt to render what it's got in its BindableCollection<DependencyObject> Items collection...?

Sep 29, 2010 at 9:21 PM

Thanks for the feedback.  I can do without the ContentTabView initially but would like to have it at some point.  I know CAlibrun.Micro supports setting ViewLookup conventions. I will need to look into it to see how it is done.  That may be the way to go.

Sep 29, 2010 at 9:34 PM

I will keep looking into this and keep you posted.  If you find your own solution for this, please post it here.