views:

324

answers:

1

For example in Sketchflow add-in there is ApplicationFlowPane (derrived from PrototypingPane) which registers itself using IWindowService like this:

    service.RegisterPalette(this.PaletteRegistryName, this, this.Caption, this.KeyBinding);  

But i can't see where it is defined that it is docked on bottom pane.
Before someone replies that it's at:
%AppData%\Microsoft\Expression\Blend3\Workspaces
No it's not there because those files do not exists at first run.

The question is how can i put my window at certain position with Expression Blend 3 plug-in api ?

update 1:

It seems that to achive what i want i have to change design.xaml (where workspaces are defined) which is loaded from satellite assembly Microsoft.Expression.Blend.resources.dll (method load in class FrameworkPackage in Microsoft.Expression.Blend.dll). But since this dll is strongly named i can't change it.

So now the question is. Is there any other way I can change Design Workspace at runtime ?

A: 

I don't know if this is solution could have blessing from MS but this works.

the key part is to operate on docked windows after everything is loaded. We do that with using of UIThreadDispatcher.

The key method is WindowProfile's Find or FindAll where you can find all docked groups and windows in running Expression Blend instance. Example below.

UIThreadDispatcher.Instance.BeginInvoke(DispatcherPriority.ApplicationIdle, delegate { this.OnLoaded(); });

now the OnLoaded method:

Workspace w =   _applicationService.WindowService().PaletteRegistry.WorkspaceService.ActiveWorkspace as Workspace;
ExpressionView ww = w.FindPalette("MY_DOCKING_WINDOW_REGISTRY_NAME")  as ExpressionView;

var resultsTab = w.WindowProfile.FindAll(p => p is TabGroup).ToArray();
if (resultsTab.Length > 0) {
TabGroup tg=  resultsTab[2] as TabGroup;
tg.DockAt(ww,-1);
}

tomaszkubacki