Probem with DialogConductor

Jan 12, 2011 at 7:36 PM

Hi there

I am using Caliburn.Micro in a SL4 LOB App and I have been spending about two days solving a problem. No way, I hope someone can help me.

I just want to show a message box using DialogConductorViewModel/DialogConductorView which contains a MessageBoxViewModel/MessageBoxView as an item. It's based on the "Hello Screens" sample of the codeplex documentation.

I have a CustomerDetailGeneralViewModel (based on DocumentBase<CustomerDetailViewModel>) which imports DialogConductor from MEF.

[Import]
public IDialogManager Dialogs { get; set; }

CustomerDetailGeneralViewModel then calls:

Dialogs.ShowMessageBox("Test Message");
So far so good.

DialogConductorViewModel looks fine when i debug (DialogConductorViewModel activates MessageBoxViewModel).

In the following method, everything looks fine while debugging:

public void ShowMessageBox(string message, string title = null, MessageBoxOptions options = MessageBoxOptions.Ok, Action<IMessageBox> callback = null)
{
            var box = createMessageBox();

            box.DisplayName = title ?? "Hello Screens";
            box.Options = options;
            box.Message = message;

            if (callback != null)
                box.Deactivated += delegate { callback(box); };

            ActivateItem(box);
 }

But the message box never shows up. I think there must be a binding problem (name convention) because the event handler OnTransitionCompleted of the CustomTransitionControl in DialogConductor.xaml is never called.

Hope someone can help me, I am very frustrated.

Many thanks

Coordinator
Jan 12, 2011 at 8:09 PM

Grab the latest version of the sample and compare the implementations with your own. There have been a couple of changes to conductors recently that might be causing your problems.

Jan 13, 2011 at 3:55 PM

Unfortunately no success. I grabed the latest caliburn and HelloScreens.

Still the same problem. :-(

Jan 13, 2011 at 8:00 PM

Is there a way in visual studio to debug xaml or get some information about binding errors?

Jan 13, 2011 at 10:16 PM

Hi Tongo 

 

Have a look at http://bea.stollnitz.com/blog/?p=52  

Bea knows her stuff !

Jan 14, 2011 at 8:42 AM

Cool stuff. Thanks a lot.

Jan 15, 2011 at 5:34 PM

Problem solved. Forgot the ContentControl in the xaml file where i want to show the message box.

Many thanks for your help