Activating nested screens

May 5, 2011 at 10:57 PM

Following the HelloScreens example I have a workspaceView (Conductor.OneActive) and then some workspaceDocumentViews.  I'm trying from my shell to spawn a new Workspace with a few document views and have it open up to a specific document.

My problem is that I can only get to the documentView via the UI.  I try calling the ActivateItem it various spots but it doesn't seem to work.  I've also played with the ActivateWith but no go.

What I expected / would like is:

Shell -Add default Workspaces with default documents and set a default document to open when I open the workspace the first time.

Shell - Activate one of the workspaces which should open to it's default page.

That is my starting point for the application.

Then if I add or toggle workspaces it should open with the defined default document (first time)  or the last active document.

I'm sure this is simple and I'm just missing something.  It wasn't clear if the ActiveWith was an 'everytime' I activate or just the first time?  I could see the usage of both.

thanks

jack

Coordinator
May 6, 2011 at 1:52 PM
Edited May 6, 2011 at 1:52 PM

ActivateWith is an extension method that caused the activation of one screen to by synchronized with the activation of another screen. It's not really related to your scenario. What you are trying to accomplish should be simple. It's hard to tell from your description where you might be going wrong. Can you provide some more information?

May 6, 2011 at 3:03 PM

Rob,

You are correct, ActivateWith is not what I want for this. If you take the HelloScreens example I basically want to open a workspace /w a specific document. I’m doing this in my shell constructor:

var d1 = new doc(…)

var d2 = new doc(…)

var d3 = new doc(…)

var d4 = new doc(…)

var w1 = new workspace()

var w2 = new workspace()

var wMain = new workspace(new docManager());

n The docManager is setup like a controller for the workspace. It creates additional required documents and adds them to the wMain.Item. it then calls ActivateItem on itself.

w1.Items.Add(d1);

w1.Items.Add(d2);

w2.Items.Add(d3);

w2.Items.Add(d4);

Items.Add(w1);

Items.Add(w2);

Items.Add(wMain);

wMain.ActicateItem.

What I am expecting is that wMain is the active workspace/view and the docManager document is the active/document.

What I get is that nothing is active. For testing I’m using two sets of itemcontrols as the icon like taskbar and I have to click on the wMain and then docManager in their respective lists.

Hopefully that is clearer…

jack

From: EisenbergEffect [email removed]
Sent: Friday, May 06, 2011 6:53 AM
To: jaddington@alexandergracie.com
Subject: Re: Activating nested screens [caliburnmicro:256570]

From: EisenbergEffect

ActivateWith is an extension method that caused the conducting one screen to by synchronized with the conducting of another screen. It's not really related to your scenario. What you are trying to accomplish should be simple. It's hard to tell from your description where you might be going wrong. Can you provide some more information?