Hello Telerik Team,
I'm working with the RadDiagram control and have a scenario where I need certain RadDiagramShapes to display their AdditionalContent persistently – meaning the content should remain visible even when the shape is not selected. Additionally, I want to achieve this behavior and customize the AdditionalContent's styling purely through MVVM binding approaches.
Could you please provide guidance or code examples demonstrating:
Any suggestions for binding strategies or relevant Shape/Style properties would be greatly appreciated. Thank you!
using System;
using System.Windows.Input;
using XXX.Core.Models.EventArgs;
using Telerik.Windows.Diagrams.Core;
namespace XXX.XXX.Presentation.Tools
{
internal class MyPanningTool : PanningTool
{
private const string PanningToolName = "Panning Tool";
private SelectionMode _selectionMode;
private ToolService _toolService;
public MyPanningTool()
{
Cursor = DiagramCursors.Dragging;
}
private void ActivatePanningTool()
{
_toolService ??= Graph.ServiceLocator.GetService<IToolService>() as ToolService;
_toolService?.ActivateTool(PanningToolName);
}
private void ActivatePointerTool()
{
_toolService ??= Graph.ServiceLocator.GetService<IToolService>() as ToolService;
_toolService?.ActivateTool("Pointer Tool");
}
public override bool KeyDown(KeyArgs key)
{
if (!IsActive) return false;
base.KeyDown(key);
if (key.Key != Key.Enter && key.Key != Key.Escape && !ToolService.IsControlDown)
{
ActivatePanningTool();
return false;
}
return false;
}
/// <inheritdoc />
public override bool MouseDown(PointerArgs e)
{
if (IsActive)
{
_selectionMode = Graph.SelectionMode;
Graph.SelectionMode = SelectionMode.None;
}
if (ToolService.IsControlDown || Mouse.MiddleButton == MouseButtonState.Pressed)
{
//ActivateTool();
//ActivatePanningTool();
return base.MouseDown(e);
}
return IsActive && base.MouseDown(e);
}
/// <inheritdoc />
public override bool MouseMove(PointerArgs e)
{
if (ToolService.IsControlDown || Mouse.MiddleButton == MouseButtonState.Pressed)
{
return base.MouseMove(e);
}
return IsActive && base.MouseMove(e);
}
/// <inheritdoc />
public override bool MouseUp(PointerArgs e)
{
if (!IsActive) return false;
Graph.SelectionMode = _selectionMode;
try
{
base.MouseUp(e);
}
catch
{
// ignored
}
if (ToolService.IsControlDown || Mouse.MiddleButton == MouseButtonState.Pressed) return base.MouseUp(e);
ActivatePointerTool();
ToolChangedEvent?.Invoke(null, new ToolChangedEventArgs("Pointer Tool"));
return true;
}
public static event EventHandler<ToolChangedEventArgs> ToolChangedEvent;
}
}
Can you please help me to creating a custom connect.
Can you give me a small example as shown in below picture.
can you please help me to created diagram show in image for using created custom edge for "avoid connection overlap" used in Graph dynamically.
I need to display a dataset of a scanned item where the dataset is a list of 3D values (X, Y and Z)
I want the diagram to display the Image as be a top-down view, using X and Y coordinates from the dataset using the the height (Z) to color encode the point using a color gradient.
Using a 3D RadCartesianChart3D component I have created something similar, see the attached RadCartesianChar3D image.
What I need now is a 2D image, something like what I try to illustrate in the attached ColorEncodedItem image.
What I need to know, is what component I should use for this job.
I expect that using a RadCartesianChart3D will be to CPU intensive for the platform I will be running this software on + I don't know, how to make a top-down view of a diagram using this component
Can you please give a small example of "AStart Router" used in routing with tree layout.
How can I show animation like the following video in diagram control with pause and play option?
Which control is used in the following image?