Change individual Pointmark visibility at runtime

4 posts, 0 answers
  1. Mike
    Mike avatar
    7 posts
    Member since:
    Apr 2009

    Posted 23 Mar 2011 Link to this post

    Hi,
    Is there any way to access an individual pointmark and change its visibility at runtime? 
    Mike
  2. Mike
    Mike avatar
    7 posts
    Member since:
    Apr 2009

    Posted 24 Mar 2011 Link to this post

    Anyone know if this is possible?

    Mike
  3. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 25 Mar 2011 Link to this post

    Hello Mike,

    There are two approaches that would allow you to customize the visibility of individual pointmarks at runtime:
    • Using the MVVM pattern as demonstrated on this demo here (basically you need to re-template the Line visual element and substitute the default PointMark.Visibility template binding there with custom Binding expression to a property in your ViewModel; then any modification to the ViewModel property at runtime, is immediately propagated to the point mark itself.
    • Alternatively you can take advantage of our UIElement.ChildrenOfType<T>() extension method and directly access the PointMark visuals to toggle their visibility.

    We have attached two sample applications that demonstrate both approaches for your reference.


    Regards,
    Giuseppe
    the Telerik team
  4. Mike
    Mike avatar
    7 posts
    Member since:
    Apr 2009

    Posted 25 Mar 2011 Link to this post

    Thanks Giuseppe,

    I'll give them a try.

    Mike
Back to Top