This project is read-only.

Module/Workspace initialization sequence problem

Mar 27, 2008 at 12:25 PM
i am having a little problem adding a WPF-UserControl, implemented in a custom module, to the TabWorkspace. I am loading the module by the profileCatalog.xml
That works but the Module is loaded before the Workspace in the WindowMain.xaml is registered so i cannot add the Usercontrol from the module to the tabWorkspace. Can someone tell me, if i can change the sequence of ínitialization?

I try to add the usercontrol in the the 'TestModul' -> TestWorkItem class in method OnRunStarted():

protected override void OnRunStarted()
IWorkspace GPSWorkspace = RootWorkItem.Workspaces"testws";
// GPSWorkspace.Show( Items.AddNew<UserControl1>());
The uncommented loc doesn t work because the workspace is not initilize by that moment.

My ProfileCatalog.xml looks like this:

<?xml version="1.0" encoding="utf-8" ?>

<SolutionProfile xmlns="" >
<ModuleInfo AssemblyFile="TestModul.dll"/>

By the way i used the WPFCAB sample project 'TabWorkSpace' for my demo.

Thanks for any help...

Mar 27, 2008 at 2:50 PM
Ok, I solved the problem :)
At least i hope so. The Error was that i created the MainWindow after too late. No my application is loaded the following way. Maybe someone can tell me, if that is the right way?


public partial class App : SCSFContrib.CompositeUI.WPF.IInitializeApplication


public sealed class Shell : SCSFContrib.CompositeUI.WPF.ApplicationShellApplication<RootWorkItem, App>
public static void Main()
new Shell().Run();

protected override void AfterShellCreated()

private void CreateMainShellWindow()
MainWindow shellWindow = new MainWindow();
Shell.MainWindow = shellWindow;
RootWorkItem.Workspaces.Add(shellWindow.tabWorkspace, "tabWorkspace");


Just created the TabWorkspace in xaml


public sealed class RootWorkItem : WorkItem
protected override void OnRunStarted()

I don t really need the class or? As long as i doesn t extend the methods i can take the Base workItem, right?

Thanks for help