MDI in caliburn, add new tab item to tab control but not active

Feb 10, 2011 at 10:55 AM

Hi I create simpel MDI in caliburn micro something like this :

App is something like chat window.

Every tab item is identified by ID (ID is DisplayName propety -> NickName).

Situation is that I have active some item, and user is chating.

Active is tab item with DisplayName User1.

It arrived new message from server, I would something create and show another tab item (DisplayName User2) in shell, but not as active.

I open new tab with this metod:

    public bool OpenChatTab(string id)
        if (!ActiveTabItems.ContainsKey(id))
            var w = IoC.Get<ITabChatViewModel>();
            w.DisplayName = id;


            return true;
        return false;

Problem is method above create, add and active new tab item I need only create and add no activated.

Thank for advice.

Feb 10, 2011 at 1:37 PM

Just add the view model to the Items collection instead of calling ActivateItem.

Feb 10, 2011 at 6:11 PM

Thank, I am newbie in caliburn framework, it was scholar problem.

Thank for feedback Mr. Eisenberg