Back to Devexpress

DiagramControl.LoadDocument(String) Method

wpf-devexpress-dot-xpf-dot-diagram-dot-diagramcontrol-dot-loaddocument-x28-system-dot-string-x29.md

latest2.2 KB
Original Source

DiagramControl.LoadDocument(String) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Loads a diagram from the specified file.

Namespace : DevExpress.Xpf.Diagram

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

NuGet Package : DevExpress.Wpf.Diagram

Declaration

csharp
public void LoadDocument(
    string fileName
)
vb
Public Sub LoadDocument(
    fileName As String
)

Parameters

NameTypeDescription
fileNameString

A string specifying the path of the file containing a diagram.

|

Remarks

Use the DiagramControl.DocumentSource property to get the current document supplier for the DiagramControl.

To implement diagram custom loading logic, handle the DiagramControl.CustomLoadDocument event.

You may encounter exceptions when loading/saving a diagram (e.g., when trying to load a diagram from a file that does not exist, or saving to a read-only file). To handle or suppress these exceptions, use the DiagramControl.ExceptionMessage event.

A diagram can be saved to a file or stream with the DiagramControl.SaveDocument method.

See Also

SaveDocument

DiagramControl Class

DiagramControl Members

DevExpress.Xpf.Diagram Namespace