Converting Wpf using Caliburn Micro to XBAP

Mar 10, 2011 at 3:56 PM

I am using Caliburn Micro in a WPF application and I want to convert that to a fuly trusted XBAP.

How can I convert Cliburn Micro Wpf app to XBAP? 

Thanks in advance.


Mar 14, 2011 at 3:05 PM

I've never done this, but I don't see why there should be any problems.

Mar 31, 2011 at 1:11 PM
Edited Apr 6, 2011 at 9:15 AM

Is there someone here who had managed do build a wpf browserapplication with CM?

I tried it based on the Basic Configuration, Actions and Conventions sample with the only difference that it is a browserapplication instead of a wpf application, but it doesn't work.

Apr 6, 2011 at 6:49 AM
Edited Apr 6, 2011 at 9:21 AM

Sorry for repeating my question. Is it possible to build a WPF-XBAP with CM? I've tried it, but it doesn't work.


Now I got it to work ... but not as I want.

There's an exception in "window manager.EnsureWindow" when setting the owner of the window. That's because the ShellView is of type "page" instead of "window". Now I changed the ShellView to "window" and it runs, but now the View is created outside the browser in a separate window.

Apr 6, 2011 at 1:35 PM

Ok. That makes sense. The full version of Caliburn works correctly. Give me a bit and I'll port that code over to Micro. I'm creating a ticket for that.

Apr 6, 2011 at 1:36 PM

Work item created:

Apr 6, 2011 at 1:57 PM

Ok. I added some code to improve this in 80e6002cd55c  Please test this out ASAP and get back to me. I'm heading for the official RTW on Monday. So, if this isn't fixed quickly, it won't be in a release for a while.

Apr 6, 2011 at 6:57 PM

Ok, the ShellView is now displayed correctly as a page (inside the browser), but it seems that there are no convention bindings added. I have a button and a TabControl for additional Views on the Shell. I checked it with the CM RC1.0 (with ShellView as window) and in this constellation the bindings are working.

Apr 6, 2011 at 8:08 PM

Can you send me a sample? robertheisenberg at hotmail dot com Thanks!

Apr 6, 2011 at 8:27 PM

I'll send the sample soon as possible.

As far as I understand it seems that in ViewModelBinder.Bind the

var namedElements = BindingScope.GetNamedElements(element)

is null. So there's nothing to bind to when calling BindActions and BindProperties.

Has "GetNamedElements" a problem with pages?

Apr 6, 2011 at 8:31 PM

I don't know....when I get your sample I'll take a close look and figure out what is happening there. The sooner you can get it to me the better. I'm planning a release on Monday.

Apr 6, 2011 at 8:53 PM

    var contentControl = current as ContentControl;
    if(contentControl != null) {

This is the line in GetNamedElement where it seems to happen. "current" contains ShellView and contentControl is null. When the View is a Window then contentControl contains DockPanel (in my specific case). I'll send the project tomorrow in the morning GMT.

Thanks for your help!

Apr 7, 2011 at 4:12 PM