ZIndex for templates

4 posts, 0 answers
  1. Jason D
    Jason D avatar
    114 posts
    Member since:
    Jan 2011

    Posted 18 Jan Link to this post

    I have a custom class that I'm adding to a VisualizationLayer. I'm using the following template to display it:

    <DataTemplate x:Key="PolygonTemplate">
        <telerik:MapPolygonView Points="{Binding Points}" ShapeFill="{Binding ShapeFill}" />
    </DataTemplate>

     

    Works great. But I don't know how to get the ZIndex working. I tried adding my own ZIndex (that calls PropertyChanged), inheriting from ExtendedDataProvider, putting Canvas.ZIndex in the template but the z-order of the item never changes. If I use a normal PolygonData with the default template, the z-order updates.

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2067 posts

    Posted 23 Jan Link to this post

    Hello Jason,

    The ZIndex property is not synced between the bindable wrapper object (like MapPolygonView) and the map shape object (like PolygonData). I have logged an item for improving this. You can find it in our feedback portal. I also updated your Telerik points.

    In the meantime you can use the MapShapeVisualizationCreated event of VisualizationLayer. The event arguments gives you access to the shape data object and you can set its ZIndex property.
    private void VisualizationLayer_MapShapeVisualizationCreated(object sender, MapShapeOperationEventArgs e)
    {
        e.Data.ZIndex = 100;
    }
    Can you please try this and let me know if it helps?

    Regards,
    Martin Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Jason D
    Jason D avatar
    114 posts
    Member since:
    Jan 2011

    Posted 23 Jan in reply to Martin Ivanov Link to this post

    Will try. Also, the only reason I am doing this is because of the issue I am having with PolygonData:

    https://www.telerik.com/forums/binding-question

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2067 posts

    Posted 24 Jan Link to this post

    Hello Jason,

    I hope this solution helps.

    About the issue described in the forum, it is not known so I can't tell what happens. However, if you share more information on the issue - like some runnable code - I can check it and see if I can help.

    Regards,
    Martin Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top