diff --git a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/RadialTree.razor b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/RadialTree.razor index 54bfe413..b08d4059 100644 --- a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/RadialTree.razor +++ b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/RadialTree.razor @@ -313,7 +313,23 @@ - + + + @{ + if (context is Node node) + { + var data = (node as Node).Data as RadialTreeDetails; + if (data != null) + { + +
+ @data.Name
@data.Designation +
+ } + } + } +
+
@*Hidden:Lines*@ @@ -487,7 +503,6 @@ node.Constraints = NodeConstraints.Default | NodeConstraints.Tooltip; node.Tooltip = new DiagramTooltip() { - Template = radialData.Name+"
"+radialData.Designation, Position = Position.TopCenter, }; } diff --git a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/Serialization.razor b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/Serialization.razor index c55f3bb6..bcb9d139 100644 --- a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/Serialization.razor +++ b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/Serialization.razor @@ -24,7 +24,7 @@

This sample demonstrates building diagrams interactively and editing saved diagrams. The symbol palette is used to build diagrams easily.

-

This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The SaveDiagram method can be used to save a diagram as a string. The LoadDiagram method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.

+

This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The SaveDiagram method can be used to save a diagram as a string. The LoadDiagramAsync method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.

@*End:Hidden*@ @*Hidden:Lines*@ diff --git a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/SymbolPalette.razor b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/SymbolPalette.razor index d913bb75..44e458f0 100644 --- a/Blazor-MAUI-Demos/Pages/Diagram/Diagram/SymbolPalette.razor +++ b/Blazor-MAUI-Demos/Pages/Diagram/Diagram/SymbolPalette.razor @@ -532,11 +532,25 @@ string description = symbol is Node ? (symbol as Node).ID : (symbol as Connector).ID; if (text) { - SymbolInfo.Description = new SymbolDescription() { Text = description, TextOverflow = TextOverflow.Wrap }; + SymbolInfo.Description = new SymbolDescription() + { + Text = description, + Style = new TextStyle() + { + TextOverflow = TextOverflow.Wrap + } + }; } else { - SymbolInfo.Description = new SymbolDescription() { Text = "", TextOverflow = TextOverflow.Wrap }; + SymbolInfo.Description = new SymbolDescription() + { + Text = "", + Style = new TextStyle() + { + TextOverflow = TextOverflow.Wrap + } + }; } return SymbolInfo; } diff --git a/Common/Pages/AISamples/Diagram/Helpers/DiagramMenuBar.razor.cs b/Common/Pages/AISamples/Diagram/Helpers/DiagramMenuBar.razor.cs index c3cfa3e2..25bc72dd 100644 --- a/Common/Pages/AISamples/Diagram/Helpers/DiagramMenuBar.razor.cs +++ b/Common/Pages/AISamples/Diagram/Helpers/DiagramMenuBar.razor.cs @@ -346,7 +346,7 @@ private async Task MenuClick(Syncfusion.Blazor.Navigations.MenuEventArgs diff --git a/Common/Pages/AISamples/Diagram/Helpers/DiagramToolBar.razor.cs b/Common/Pages/AISamples/Diagram/Helpers/DiagramToolBar.razor.cs index d0aa6b94..7a38fe56 100644 --- a/Common/Pages/AISamples/Diagram/Helpers/DiagramToolBar.razor.cs +++ b/Common/Pages/AISamples/Diagram/Helpers/DiagramToolBar.razor.cs @@ -30,7 +30,7 @@ public partial class DiagramToolBar /// In a Blazor application, this property should be set to an instance of the IJSRuntime interface provided by the framework. /// [Inject] - protected IJSRuntime? jsRuntime { get; set; } = null!; + protected IJSRuntime jsRuntime { get; set; } #pragma warning disable CS8618 /// /// Represents the DiagramMain instance that serves as the parent. diff --git a/Common/Pages/AISamples/Diagram/TextToMindMap.razor b/Common/Pages/AISamples/Diagram/TextToMindMap.razor index b6aa5ebe..01a2bcaa 100644 --- a/Common/Pages/AISamples/Diagram/TextToMindMap.razor +++ b/Common/Pages/AISamples/Diagram/TextToMindMap.razor @@ -12,7 +12,7 @@ @using DiagramShapes = Syncfusion.Blazor.Diagram.NodeShapes @using DiagramSegments = Syncfusion.Blazor.Diagram.ConnectorSegment @using Orientation= Syncfusion.Blazor.Diagram.Orientation -@using shapes = Syncfusion.Blazor.Diagram.NodeShapes +@using Shapes = Syncfusion.Blazor.Diagram.NodeShapes @using BlazorDemos.Service @inject AzureAIService ChatGptService @@ -304,8 +304,8 @@ { Diagram.BeginUpdate(); RemoveData(Diagram.SelectionSettings.Nodes[0], Diagram); - _ = Diagram.EndUpdate(); - await Diagram.DoLayout(); + _ = Diagram.EndUpdateAsync(); + await Diagram.DoLayoutAsync(); } if (obj.Name == "fitPage") { @@ -667,7 +667,7 @@ }; diagram.BeginUpdate(); await UpdatePortConnection(childNode, diagram, isSibling); - await diagram.EndUpdate(); + await diagram.EndUpdateAsync(); } // Custom tool to add the node. public class AddLeftTool : InteractionControllerBase @@ -716,7 +716,7 @@ TargetID = node.ID, SourceID = isSibling ? childNode.ParentId : diagram.SelectionSettings.Nodes[0].ID }; - await diagram.AddDiagramElements(new DiagramObjectCollection() { node, connector }); + await diagram.AddDiagramElementsAsync(new DiagramObjectCollection() { node, connector }); Node sourceNode = diagram.GetObject((connector as Connector).SourceID) as Node; Node targetNode = diagram.GetObject((connector as Connector).TargetID) as Node; if (targetNode != null && targetNode.AdditionalInfo.Count > 0) @@ -733,7 +733,7 @@ (connector as Connector).TargetPortID = targetNode.Ports[0].ID; } } - await diagram.DoLayout(); + await diagram.DoLayoutAsync(); } public void ZoomTo(ZoomOptions options) { @@ -822,7 +822,7 @@ }; diagram.BeginUpdate(); await UpdatePortConnection(childNode, diagram, isSibling); - await diagram.EndUpdate(); + await diagram.EndUpdateAsync(); } // Custom tool to add the node. public class AddRightTool : InteractionControllerBase @@ -861,8 +861,8 @@ { sfDiagram.BeginUpdate(); RemoveData(deleteObject, sfDiagram); - _ = sfDiagram.EndUpdate(); - await sfDiagram.DoLayout(); + _ = sfDiagram.EndUpdateAsync(); + await sfDiagram.DoLayoutAsync(); } base.OnMouseUp(args); this.InAction = true; @@ -934,7 +934,7 @@ node.Height = 50; node.Width = 100; - node.Shape = new BasicShape() { Type = shapes.Basic, Shape = NodeBasicShapes.Ellipse }; + node.Shape = new BasicShape() { Type = Shapes.Basic, Shape = NodeBasicShapes.Ellipse }; PointPort port21 = new PointPort() { ID = "left", diff --git a/Common/Pages/Diagram/Diagram/NodeTemplateSample.razor b/Common/Pages/Diagram/Diagram/NodeTemplateSample.razor index f2dde36f..0e57efb7 100644 --- a/Common/Pages/Diagram/Diagram/NodeTemplateSample.razor +++ b/Common/Pages/Diagram/Diagram/NodeTemplateSample.razor @@ -4,7 +4,7 @@ @using Syncfusion.Blazor.Charts @using Syncfusion.Blazor.Calendars @using Syncfusion.Blazor.Grids -@using shapes = Syncfusion.Blazor.Diagram.NodeShapes +@using Shapes = Syncfusion.Blazor.Diagram.NodeShapes @namespace BlazorDemos.Pages @*Hidden:Lines*@ @inherits SampleBaseComponent; @@ -421,7 +421,7 @@ Annotations = new DiagramObjectCollection() { new ShapeAnnotation() { Constraints = AnnotationConstraints.ReadOnly } }, Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select, OffsetY = 380, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; Node lineChartNode = new Node() { @@ -431,7 +431,7 @@ OffsetX = 870, Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select, OffsetY = 810, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML }, + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML }, }; Node barChartNode = new Node() { @@ -441,7 +441,7 @@ OffsetX = 325, Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select, OffsetY = 810, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; Node datePickerNode = new Node() { @@ -451,7 +451,7 @@ OffsetX = 1000, Constraints = NodeConstraints.Default & ~NodeConstraints.Resize & ~NodeConstraints.Rotate& ~NodeConstraints.Select, OffsetY = 170, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; TextStyle textStyle = new TextStyle() { @@ -485,7 +485,7 @@ Constraints = NodeConstraints.Default & ~NodeConstraints.Select, //Style = new ShapeStyle() { StrokeColor = "Transparent" }, OffsetY = 90, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; Node expenseNode = new Node() { @@ -496,7 +496,7 @@ Constraints = NodeConstraints.Default & ~NodeConstraints.Select, OffsetY = 90, Style = new ShapeStyle() { StrokeColor = "Transparent" }, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; Node balanceNode = new Node() { @@ -507,7 +507,7 @@ Constraints = NodeConstraints.Default & ~NodeConstraints.Select, OffsetY = 90, Style = new ShapeStyle() { StrokeColor = "Transparent" }, - Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = shapes.HTML } + Shape = new Syncfusion.Blazor.Diagram.Shape() { Type = Shapes.HTML } }; nodes.Add(pieChartNode); diff --git a/Common/Pages/Diagram/Diagram/Serialization.razor b/Common/Pages/Diagram/Diagram/Serialization.razor index 7259ef73..c2cdbac7 100644 --- a/Common/Pages/Diagram/Diagram/Serialization.razor +++ b/Common/Pages/Diagram/Diagram/Serialization.razor @@ -19,7 +19,7 @@

This sample demonstrates building diagrams interactively and editing saved diagrams. The symbol palette is used to build diagrams easily.

-

This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The SaveDiagram method can be used to save a diagram as a string. The LoadDiagram method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.

+

This example shows how to drag and drop shapes and connectors from the symbol palette to build diagrams. You can save a diagram as a JSON file and edit saved diagrams. The SaveDiagram method can be used to save a diagram as a string. The LoadDiagramAsync method can be used to load a diagram from a string. In this example, the undo and redo features are enabled.

@*End:Hidden*@ @*Hidden:Lines*@ diff --git a/Common/Pages/Diagram/Diagram/SymbolPalette.razor b/Common/Pages/Diagram/Diagram/SymbolPalette.razor index 9cfe2bd2..0941bf95 100644 --- a/Common/Pages/Diagram/Diagram/SymbolPalette.razor +++ b/Common/Pages/Diagram/Diagram/SymbolPalette.razor @@ -521,11 +521,25 @@ string description = symbol is Node ? (symbol as Node).ID : (symbol as Connector).ID; if (text) { - SymbolInfo.Description = new SymbolDescription() { Text = description, TextOverflow = TextOverflow.Wrap }; + SymbolInfo.Description = new SymbolDescription() + { + Text = description, + Style = new TextStyle() + { + TextOverflow = TextOverflow.Wrap + }, + }; } else { - SymbolInfo.Description = new SymbolDescription() { Text = "", TextOverflow = TextOverflow.Wrap }; + SymbolInfo.Description = new SymbolDescription() + { + Text = "", + Style = new TextStyle() + { + TextOverflow = TextOverflow.Wrap + }, + }; } return SymbolInfo; }