How can I find real position of RadDiagramShape in the screen?

6 posts, 0 answers
  1. Mahmut
    Mahmut avatar
    22 posts
    Member since:
    Nov 2014

    Posted 25 Mar 2015 Link to this post

    Hi,
    I try to find real position of shape. Position object in the shape doesn't provide it. I think you have a kind of position mechanism. I have a shape object, and I get diagram object by using the shape object.
    I tried

    DiagramExtensions.GetTransformedPoint(diagram,shape.Position);

    ,but it return same value.

    And I tried this

    var parent = ParentFinder.GetAncestor<RadDiagram>(shape);
    var transformedPoint = shape.TransformToAncestor(parent)
                  .Transform(new Point(0, 0));

    but it return different value.
    Actually I try to show popup which is positioned to shape object. I can try to position to Content, but then drag or selection operation handled by shape object.
    How can I find real position of RadDiagramShape in the screen? or How can I show a popup according to position of the shape object.

    Thanks in advance.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 26 Mar 2015 Link to this post

    Hi Mahmut,

    You can take advantage of the ItemInformationAdorner.AdditionalContent property. It is of type object and you can visualize anything in it. Please note that this content is visualized when a shape is selected. An example of its usage is the SettingsPane extension control

    The only concern about this property may be the fact that it is shared among all shapes. 

    Regards,
    Pavel R. Pavlov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mahmut
    Mahmut avatar
    22 posts
    Member since:
    Nov 2014

    Posted 27 Mar 2015 in reply to Pavel R. Pavlov Link to this post

    Hi Pavel,
    Thanks for your answer. Like you said, InformationAdorner is shown, when item is selected. I want to show TextBlock for all items. TextBlock visibility and text changes according to some inputs. In addition, each item has different text property and format. If I put TextBlock in content of shape, then Connector margin will be changed( Connector must be placed with reference to my custom shape ). If I defined custom connectors, I must define for all format. So I must know How can I place a UIElement with reference to RadDiagramShape.
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 31 Mar 2015 Link to this post

    Hello,

    As far as I understand you need to show a separate TextBlock for all shapes. What I do not understand is why you want to host all those UI Elements outside the RadDiagram framework. This will require you to manually reposition all popups on every user interaction. This will most probably drop the overall performance of your application. This is why we highly recommend to you to reconsider your requirements and concrete implementation. There should be a better way to implement your scenario using our components only. There is no need you to manually position every one TextBlock that you need to host.

    Please provide us with detailed information about your scenario and we will try to think of a better approach for you to implement. The more detailed the information is the more accurate the suggested approach will be. Everything regarding your scenario and requirements (e.g. pictures, mockups, videos, snippets...) may be of help.

    Regards,
    Pavel R. Pavlov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Mahmut
    Mahmut avatar
    22 posts
    Member since:
    Nov 2014

    Posted 31 Mar 2015 in reply to Pavel R. Pavlov Link to this post

    Hi,
    thanks for your response. Yes you are right, so I try to many things to handle this in RadDiagram Framework, but I couldn't. How can I solve this in the framework?. Actually I try to create a kind of InformationAdorner. There is only one difference, it will be active for all items, not only selected items.
  7. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 01 Apr 2015 Link to this post

    Hello,

    Since you need to always show any information regarding each one of the shapes all the time, why don't you try hosting that information in the Content of the RadDiagramShape? I still cannot see any meaningful reason which forces you to visualize that particular information in separate UI Element outside our RadDiagram Framework. The best way to approach this issue is to host the information inside the shape itself.

    Moreover, if you need to host that information outside our control this requirement goes beyond our support services since it does not concern any issues related to our controls. Finding the physical position of any UI Element rendered on your screen is a general programming question and we suggest looking for an answer in other community driven online resources (like StackOverflow).

    Regards,
    Pavel R. Pavlov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready