This is a migrated thread and some comments may be shown as answers.

VisualizationLayer Items Virtualization and ShapeFill

1 Answer 77 Views
Map
This is a migrated thread and some comments may be shown as answers.
Matthes
Top achievements
Rank 1
Matthes asked on 11 Aug 2015, 07:19 PM

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 ?


 
 

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 14 Aug 2015, 07:35 AM
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
Tags
Map
Asked by
Matthes
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or