Back to Devexpress

IWorkspaceManager.LoadWorkspace(String, Object) Method

wpf-devexpress-dot-xpf-dot-core-dot-iworkspacemanager-dot-loadworkspace-x28-system-dot-string-system-dot-object-x29.md

latest3.8 KB
Original Source

IWorkspaceManager.LoadWorkspace(String, Object) Method

Loads a workspace from the specified file or stream, and adds it to the IWorkspaceManager.Workspaces collection under the specified name.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
bool LoadWorkspace(
    string name,
    object path
)
vb
Function LoadWorkspace(
    name As String,
    path As Object
) As Boolean

Parameters

NameTypeDescription
nameString

A String that specifies the name which should be assigned to the loaded workspace.

| | path | Object |

The source from which the workspace is loaded.

|

Returns

TypeDescription
Boolean

true if the workspace has been successfully loaded; otherwise, false.

|

Remarks

The LoadWorkspace method can load workspaces from files and streams. To load a workspace from a file, pass the String, specifying the path to the file, as the path parameter. To load a workspace from a stream, pass the Stream object instead.

Use the IWorkspaceManager.SaveWorkspace method to save a workspace to a file or stream.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LoadWorkspace(String, Object) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-dock-layout-manager-upgrade-layouts-between-versions/CS/MainWindow.xaml.cs#L32

csharp
var manager = WorkspaceManager.GetWorkspaceManager(dockLayoutManager);
manager.LoadWorkspace(workspaceName, layoutPath);
manager.ApplyWorkspace(workspaceName);

wpf-dock-layout-manager-upgrade-layouts-between-versions/VB/MainWindow.xaml.vb#L41

vb
Dim manager = WorkspaceManager.GetWorkspaceManager(Me.dockLayoutManager)
manager.LoadWorkspace(workspaceName, layoutPath)
manager.ApplyWorkspace(workspaceName)

See Also

SaveWorkspace(String, Object)

Workspaces

IWorkspaceManager Interface

IWorkspaceManager Members

DevExpress.Xpf.Core Namespace