Telerik Forums
UI for WPF Forum
0 answers
10 views

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:

  1. How to keep AdditionalContent visible for specific shapes regardless of selection state.
  2. How to dynamically style AdditionalContent (e.g., colors, templates) using MVVM properties.

Any suggestions for binding strategies or relevant Shape/Style properties would be greatly appreciated. Thank you!

Joey
Top achievements
Rank 1
 asked on 16 Apr 2025
0 answers
47 views
I am using the RadDiagram component inside a WPF application for a sketching software. The default behavior of the RadDiagram is to enable movement of the diagram with the Ctrl + Left click and drag shortcut. I want to enable the program to also work with Middle mouse button click and drag. Currently, I am using custom RadDiagram tools, which derive from their base classes. For example, MyPanningTool: 


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;
    }
}

I've tried to capture the Middle mouse click event on the RadDiagram and transfer them to the Panning tool Mouse click and and Move events, but this doesn't seem to do the trick.
Pavel
Top achievements
Rank 1
 updated question on 26 Nov 2024
0 answers
39 views

Can you please help me to creating  a custom connect.

Can you give me a small example as shown in below picture.

Parth
Top achievements
Rank 1
Iron
Iron
 updated question on 02 Oct 2024
0 answers
36 views
can you please send me a sample project to creating diagram dynamic layout algorithm using very minimum connection overlpping.
Parth
Top achievements
Rank 1
Iron
Iron
 asked on 24 Sep 2024
0 answers
46 views

can you please help me to created diagram show in image for using created custom edge for "avoid connection overlap" used in Graph  dynamically.

 

Parth
Top achievements
Rank 1
Iron
Iron
 updated question on 11 Sep 2024
1 answer
56 views
Can you please help me to Download Diagram in .svg file.
Martin Ivanov
Telerik team
 answered on 03 Sep 2024
1 answer
52 views

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

Martin Ivanov
Telerik team
 answered on 08 Aug 2024
0 answers
50 views

Can you please give a small example of "AStart Router" used in routing with tree layout.

 

Parth
Top achievements
Rank 1
Iron
Iron
 asked on 28 May 2024
0 answers
54 views
Is the TableShape solution from the Demos application available for download? I've tried using the SDK samples browser and looking in Github repo. I can't find it. Also, does it support Drag and Drop?
Will
Top achievements
Rank 1
Iron
 asked on 23 May 2024
1 answer
64 views

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?

Martin Ivanov
Telerik team
 answered on 16 May 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?