DiagramEditorControl

StockSharp.Xaml.Diagram.Avalonia.Controls

Avalonia Diagramm Editorsteuerung mit Symbolleiste und Tastaturkürzeln.

Erbt von: UserControl

Konstruktoren

DiagramEditorControl
public DiagramEditorControl()
diagramEditorControl = DiagramEditorControl()

Initialisiert eine neue Instanz von DiagramEditorControl.

Eigenschaften

CanPaste
public bool CanPaste { get; }
value = diagramEditorControl.CanPaste

Ob Paste verfügbar ist.

CanRedo
public bool CanRedo { get; }
value = diagramEditorControl.CanRedo

Ob Redo verfügbar ist.

CanUndo
public bool CanUndo { get; }
value = diagramEditorControl.CanUndo

Ob Undo verfügbar ist.

Composition
public CompositionDiagramElement Composition { get; set; }
value = diagramEditorControl.Composition
diagramEditorControl.Composition = value

Das Kompositionselement wird bearbeitet.

IsEditing
public bool IsEditing { get; set; }
value = diagramEditorControl.IsEditing
diagramEditorControl.IsEditing = value

Ob Editing aktiviert ist.

Panel
public DiagramPanel Panel { get; }
value = diagramEditorControl.Panel

Das Diagrammfeld.

SelectedElement
public DiagramElement SelectedElement { get; }
value = diagramEditorControl.SelectedElement

Ausgewähltes Element.

SelectedNodeKey
public string SelectedNodeKey { get; }
value = diagramEditorControl.SelectedNodeKey

Ausgewählter Knotenschlüssel.

ShowToolbar
public bool ShowToolbar { get; set; }
value = diagramEditorControl.ShowToolbar
diagramEditorControl.ShowToolbar = value

Ob man die Symbolleiste zeigt.

Zoom
public double Zoom { get; set; }
value = diagramEditorControl.Zoom
diagramEditorControl.Zoom = value

Aktueller Zoom-Level.

Methoden

AddElement
public void AddElement(DiagramElement element)
diagramEditorControl.AddElement(element)

Fügt ein Element zum Diagramm an der Standardposition (0, 0) hinzu.

element
Das Element zum Hinzufügen.
AddElementAt
public void AddElementAt(DiagramElement element, double x, double y)
diagramEditorControl.AddElementAt(element, x, y)

Fügt ein Element zum Diagramm an einer bestimmten Position hinzu.

element
Das Element zum Hinzufügen.
x
X-Position auf Canvas (Diagrammkoordinaten).
y
Y-Position auf der Leinwand (Diagrammkoordinaten).
ClearDiagram
public void ClearDiagram()
diagramEditorControl.ClearDiagram()

Löschen Sie alle Elemente aus dem Diagramm.

ConnectPalette
public void ConnectPalette(DiagramPaletteControl palette)
diagramEditorControl.ConnectPalette(palette)

Verbindet eine Palettensteuerung mit diesem Editor für die Drag-Drop-Unterstützung.

palette
Die Palettensteuerung zum Verbinden.
Copy
public void Copy()
diagramEditorControl.Copy()

Kopieren Sie ausgewählte Elemente in das Clipboard.

Cut
public void Cut()
diagramEditorControl.Cut()

Schneiden Sie ausgewählte Elemente in die Zwischenablage.

Delete
public void Delete()
diagramEditorControl.Delete()

Ausgewählte Elemente löschen.

DisconnectPalette
public void DisconnectPalette(DiagramPaletteControl palette)
diagramEditorControl.DisconnectPalette(palette)

Trennt eine Palettensteuerung von diesem Editor.

palette
Die Palettensteuerung zum Abschalten.
ExportToImage
public void ExportToImage(string filePath, ExportOptions options)
diagramEditorControl.ExportToImage(filePath, options)

Exportieren Sie das Diagramm in eine Bilddatei.

filePath
Der Ausgabedateipfad.
options
Exportieren Sie Optionen. Wenn null, verwendet Sie Standardwerte.
ExportToImageBytes
public byte[] ExportToImageBytes(ExportOptions options)
result = diagramEditorControl.ExportToImageBytes(options)

Exportieren Sie das Diagramm in ein Byte-Array.

options
Exportieren Sie Optionen. Wenn null, verwendet Sie Standardwerte.

Rückgabe: Die Bilddaten sind als Bytes oder null, wenn der Export fehlgeschlagen ist.

ExportToImageStream
public void ExportToImageStream(Stream stream, ExportOptions options)
diagramEditorControl.ExportToImageStream(stream, options)

Exportieren Sie das Diagramm in einen Bildstrom.

stream
Der Output Stream.
options
Exportieren Sie Optionen. Wenn null, verwendet Sie Standardwerte.
HandleDrop
public void HandleDrop(DragEventArgs e)
diagramEditorControl.HandleDrop(e)

Behandeln Sie Drop-Events auf dem Panel. Rufen Sie dies von DragOver/Drop-Events auf.

HandlePaletteDrop
public DiagramElement HandlePaletteDrop(PaletteItem item, Point dropPosition)
result = diagramEditorControl.HandlePaletteDrop(item, dropPosition)

Behandelt Drag-Events aus einer Palettensteuerung. Rufen Sie dies aus dem Event-Handler der Palette auf DragStarted.

item
Der Palettenartikel wird gezogen.
dropPosition
Die Position auf dem Panel, wo das Element fallen gelassen wurde (Bildschirmkoordinaten).

Rückgabe: Das erstellte Element oder null, wenn die Schöpfung fehlgeschlagen ist.

LoadFromFile
public static DiagramFileData LoadFromFile(string filePath)
result = DiagramEditorControl.LoadFromFile(filePath)

Ladediagrammdaten aus einer Datei. Hinweis: Diese gibt nur die Datenstruktur zurück.

filePath
Der Dateipfad zum Laden von.

Rückgabe: Dateidaten grafisch darstellen oder null, wenn ungültig.

LoadFromStream
public static DiagramFileData LoadFromStream(Stream stream)
result = DiagramEditorControl.LoadFromStream(stream)

Ladediagrammdaten aus einem Stream Hinweis: Dies gibt nur die Datenstruktur zurück Verwenden Sie das Laden der Zusammensetzung für die vollständige Wiederherstellung.

stream
Der stream zum lesen.

Rückgabe: Dateidaten grafisch darstellen oder null, wenn ungültig.

OnPropertyChanged
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
diagramEditorControl.OnPropertyChanged(change)
Paste
public void Paste()
diagramEditorControl.Paste()

Pastenelemente aus Clipboard.

Redo
public void Redo()
diagramEditorControl.Redo()

Wiederholen Sie die letzte rückgängig gemachte Operation.

RestoreDiagram
public bool RestoreDiagram(DiagramFileData data, ElementFactory elementFactory)
result = diagramEditorControl.RestoreDiagram(data, elementFactory)

Stellen Sie ein Diagramm aus Dateidaten in die aktuelle Zusammensetzung wieder her.

data
Die Dateidaten, aus denen Sie wiederherstellen möchten.
elementFactory
Optionale Fabrik zum Erstellen von Elementen nach Typ.

Rückgabe: Es stimmt, wenn die Wiederherstellung erfolgreich war.

RestoreFromFile
public bool RestoreFromFile(string filePath, ElementFactory elementFactory)
result = diagramEditorControl.RestoreFromFile(filePath, elementFactory)

Stellen Sie ein Diagramm aus einer Datei in die aktuelle Zusammensetzung wieder her.

filePath
Der Dateipfad zum Wiederherstellen von.
elementFactory
Optionale Fabrik zum Erstellen von Elementen nach Typ.

Rückgabe: Es stimmt, wenn die Wiederherstellung erfolgreich war.

SaveToFile
public void SaveToFile(string filePath)
diagramEditorControl.SaveToFile(filePath)

Speichern Sie das Diagramm in einer Datei.

filePath
Der Dateipfad zum Speichern.
SaveToStream
public void SaveToStream(Stream stream)
diagramEditorControl.SaveToStream(stream)

Speichern Sie das Diagramm in einem Stream.

stream
Der stream zum schreiben.
SaveToString
public string SaveToString()
result = diagramEditorControl.SaveToString()

Speichern Sie das Diagramm in einem JSON-String.

Rückgabe: JSON Darstellung des Diagramms.

SelectAll
public void SelectAll()
diagramEditorControl.SelectAll()

Wählen Sie alle Elemente aus.

Undo
public void Undo()
diagramEditorControl.Undo()

Undo die letzte Operation.

Ereignisse

ModelModified
public event EventHandler ModelModified
diagramEditorControl.ModelModified += handler

Tritt auf, wenn das Diagrammmodell geändert wird.

SelectionChanged
public event EventHandler<DiagramElement> SelectionChanged
diagramEditorControl.SelectionChanged += handler

Tritt auf, wenn sich das ausgewählte Diagrammelement ändert.

Felder

CompositionProperty
public static readonly StyledProperty<CompositionDiagramElement> CompositionProperty
value = DiagramEditorControl.CompositionProperty

Bestimmt die Composition Dependency Property.

IsEditingProperty
public static readonly StyledProperty<bool> IsEditingProperty
value = DiagramEditorControl.IsEditingProperty

Identifiziert die Abhängigkeitseigenschaft IsEditing.

ShowToolbarProperty
public static readonly StyledProperty<bool> ShowToolbarProperty
value = DiagramEditorControl.ShowToolbarProperty

Identifiziert die Abhängigkeitseigenschaft ShowToolbar.