SuperMap.WindowsPhone.Core.Feature.SetBoundedStyle C# (CSharp) Method

SetBoundedStyle() private method

private SetBoundedStyle ( SuperMap style ) : void
style SuperMap
return void
        internal void SetBoundedStyle(SuperMap.WindowsPhone.Core.Style style)
        {
            if (this.dataContext.Style != style)
            {
                this.dataContext.Style = style;
                this.RaisePropertyChanged("Style");
                this.SetElementReference(null);
            }
        }

Usage Example

        public FeatureElement(Feature f, IRenderer renderer)
        {
            this.ClipBox = Rectangle2D.Empty;
            this.pathIsInvalid = true;
            if (f == null)
            {
                throw new ArgumentNullException("f");
            }
            this.feature = new WeakReference(f);
            if (renderer != null)
            //if (renderer != null && (f.GetValue(Clusterer.ClusterProperty) == null))
            {
                this.GeoStyle = renderer.GetStyle(f) ?? generateDefaultSyle(f);
            }//renderer的优先级高于Feature自我的
            else
            {
                this.GeoStyle = f.Style ?? generateDefaultSyle(f);
            }
            f.SetBoundedStyle(this.GeoStyle);

            if (this.GeoStyle != null)
            {
                base.Template = this.GeoStyle.ControlTemplate;
            }

            this.Geometry = f.Geometry;
        }