Connectors and Connections

6 posts, 0 answers
  1. Dmitriy
    Dmitriy avatar
    2 posts
    Member since:
    Apr 2013

    Posted 04 Jun 2013 Link to this post

    I have a couple of questions:

    1. Is there a quick way to change Connector's tooltip?

    2. I want to prevent a connection creation in certain situations, e.g. create an unconnected node from one of sides. What is the best way to do it?
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 05 Jun 2013 Link to this post

    Hi Semyon,
    I'll try to answer you questions here:
    1. Yes you can change the default tooltip of our connectors and the easiest way to do it is with custom localization manager:
    public Example()
    {
        InitializeComponent();
        LocalizationManager.Manager = new CustomLocalizationManager();
    }
    and
    public class CustomLocalizationManager : LocalizationManager
    {
        public override string GetStringOverride(string key)
        {
            if ("Diagram_Connector".Equals(key))
                return "custom connector tooltip";
     
            return base.GetStringOverride(key);
        }
    }
    2. You should try out the ConnectionManipulationStarted and ConnectionManipulationCompleted events and handle them if you don't want to create this connection with something like this:
    private void OnConnectionManipulationStarted(object sender, ManipulationRoutedEventArgs e)
    {
        if(e.Shape == someShapeIDon'tWantConnectionsFrom)
            e.Handled = true;
    }
    I hope I was able to help you and if you have further questions please feel free to ask.

    Regards,
    Zarko
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dmitriy
    Dmitriy avatar
    2 posts
    Member since:
    Apr 2013

    Posted 06 Jun 2013 Link to this post

    Thank you, Zarko.

    1. However, what if I want a different tooltip for different connectors? Can I do it?

    2. Thanks. It is work with ConnectionManipulationStarted, but if I do e.Handled = true within ConnectionManipulationCompleted nothing happens.

     

  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 10 Jun 2013 Link to this post

    Hi Semyon,
    In order to do this you'll have to edit the template of the RadDiagramConnector and change it's toolTip to something like this:
    <ToolTip Content="{TemplateBinding Tag}" />
    because it uses our LocalizationManager by default.
    After this you could directly add the your connectors in xaml:
    <telerik:RadDiagramShape Content="2"
                             Position="300 100"
                             UseDefaultConnectors="False">
        <telerik:RadDiagramShape.Connectors>
            <telerik:RadDiagramConnector Name="Left"
                                         Tag="Connector 1"
                                         Offset="0 0.5" />
            <telerik:RadDiagramConnector Name="Top"
                                         Tag="Connector 2"
                                         Offset="0.5 0" />
            <telerik:RadDiagramConnector Name="Right"
                                         Tag="Connector 3"
                                         Offset="1 0.5" />
            <telerik:RadDiagramConnector Name="Bottom"
                                         Tag="Connector 4"
                                         Offset="0.5 1" />
            <telerik:RadDiagramConnector Name="Auto"
                                         Tag="Connector 5"
                                         Offset="0.5 0.5" />
        </telerik:RadDiagramShape.Connectors>
    </telerik:RadDiagramShape>
    or use custom attached property:
    <telerik:RadDiagramShape Content="1"
                     Position="100 100"
                     UseDefaultConnectors="False"
                     local:MyProperties.MyConnectors="{StaticResource connectors}" />
    The second issue should be fixed in our next official release later this week.
    I've attached a sample project so could you please examine it and if you have further questions feel free to ask.

    Regards,
    Zarko
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Jeff
    Jeff avatar
    2 posts
    Member since:
    Jun 2015

    Posted 30 Jun 2015 Link to this post

    Hi There, I've a tricky question about connector and connection.

    I need to develop a GUI where I can let the user define a connector by 3 points : A-start, C-end and a third one (B) to adapt the resulting curve to a set of points (to match the more it can the shape).

    Once done, how can I access polyline parameters between A and B, B and C.

    The main goal is to retrieve the equation between the three points. I know it can be done through an equation system solving, but do the TELERIK object is providing any useful attributes or methods?

    Let me know please

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Jul 2015 Link to this post

    Hello Jeff,

    We answered your question in the following forum thread. Please use only one new thread for new questions which are not related to questions in the current one. This will make the tracking and searching the forums easier. Thank you in advance for your understanding.

    Regards,
    Petar Mladenov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready