Hiding Pads and Closing Documents

3/30/2010 8:18 PM
You can subscribe to this wiki article using an RSS feed reader.


Hiding Pads

Assuming you already have a reference to both the layout manager and your pad (which you've already shown):

    [Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
    private Lazy<ILayoutManager> layoutManager { get; set; }

    [Import(
CompositionPoints.Workbench.Pads.MyPad, typeof(MyPad))]
    private Lazy<MyPad> myPad { get; set; }

You can hide just this specific pad:

    layoutManager.Value.HidePad(myPad.Value);

... or you can hide all pads:

    layoutManager.Value.HideAllPads();

Closing Documents

Assuming you already have a reference to both the layout manager and a document you've opened:

    [Import(SoapBox.Core.Services.Layout.LayoutManager, typeof(ILayoutManager))]
    private Lazy<ILayoutManager> layoutManager { get; set; }

    [Import(
CompositionPoints.Workbench.Documents.MyDocument, typeof(MyDocument))]
    private Lazy<MyDocument> myDocument { get; set; }

    MyDocument myDocInstance =
           layoutManager.Value.ShowDocument(myDocument.Value, "blah");

You can close just this specific document instance:

    layoutManager.Value.CloseDocument(myDocInstance);

... or ou can close all documents:

    layoutManager.Value.CloseAllDocuments();

Tags:
Home: SoapBox Core What's new: Recently changed articles