VisualizationLayer Items Virtualization and ShapeFill

2 posts, 1 answers
  1. Matthes
    Matthes avatar
    4 posts
    Member since:
    Sep 2014

    Posted 11 Aug 2015 Link to this post

    Hello everyone,

    I have a VisualizationLayer with ShapeFills set on the layer level by using

    <telerik:VisualizationLayer.ShapeFill>

    ...

    </telerik:VisualizationLayer.ShapeFill>

    If the ShapeFill of the MapShapedata is changed in code (for example by selecting some elments from a list and then call .UseSelectedFill() ) and then a MapItemsRequest happens, the original ShapeFill of the items will be restored instead of keeping the "manually" set ShapeFill. How can I make them keep their ShapeFill ?


     
     
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 14 Aug 2015 Link to this post

    Hello Matthes,

    When you use the public methods UseHighlightFill(), UseRegularFill(), UseSelectedFill(), they set locally the ActiveShapeFill property which is used in the ShapeTemplate. Here are the methods implementations:
        /// <summary>
            /// Use highlight fill and stroke settings.
            /// </summary>
            public void UseHighlightFill()
            {
                if (this.HighlightFill != null)
                {
                    this.IsHighlighted = true;
                    this.ActiveShapeFill = this.HighlightFill;
                }
            }
     
    /// <summary>
            /// Use regular fill and stroke settings.
            /// </summary>
            public void UseRegularFill()
            {
                if (this.ShapeFill != null)
                {
                    this.IsHighlighted = false;
                    this.IsSelected = false;
                    this.ActiveShapeFill = this.ShapeFill;
                }
            }
     
        /// <summary>
            /// Use selected fill and stroke settings.
            /// </summary>
            public void UseSelectedFill()
            {
                if (this.SelectedFill != null)
                {
                    this.IsSelected = true;
                    this.ActiveShapeFill = this.SelectedFill;
                }
            }

    So in order to use ActiveShapeFill set by you in the full lifetime of a shape data object, you need to set this property to your value and set the other three properties ( SelectedFill, HighlightFill, RegularFill) to null.

    Please let us know if this works in your scenario.

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top