Beispiel #1
0
        /// <summary>
        /// Update CalloutStyle of Feature
        /// </summary>
        private void UpdateCalloutStyle()
        {
            CalloutStyle style = (CalloutStyle)Feature.Styles.Where((s) => s is CalloutStyle).FirstOrDefault();

            if (style == null)
            {
                style = new CalloutStyle();
                Feature.Styles.Add(style);
            }

            style.ArrowAlignment             = ArrowAlignment;
            style.ArrowHeight                = (float)ArrowHeight;
            style.ArrowPosition              = (float)ArrowPosition;
            style.BackgroundColor            = BackgroundColor.ToMapsui();;
            style.Color                      = Color.ToMapsui();
            style.SymbolOffset               = new Offset(Anchor.X, Anchor.Y);
            style.SymbolOffsetRotatesWithMap = _pin.RotateWithMap;
            style.Padding                    = new BoundingBox(Padding.Left, Padding.Top, Padding.Right, Padding.Bottom);
            style.RectRadius                 = (float)RectRadius;
            style.RotateWithMap              = RotateWithMap;
            style.Rotation                   = (float)Rotation;
            style.ShadowWidth                = (float)ShadowWidth;
            style.StrokeWidth                = (float)StrokeWidth;
            style.Content                    = Content;
        }
Beispiel #2
0
        /// <summary>
        /// Check if something important for Map changed
        /// </summary>
        /// <param name="propertyName">Name of property which changed</param>
        protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            base.OnPropertyChanged(propertyName);

            // Set new BackgroundColor to nativeMap
            if (propertyName.Equals(nameof(BackgroundColor)))
            {
                map.BackColor = BackgroundColor.ToMapsui();
            }

            if (propertyName.Equals(nameof(Center)))
            {
                // Center changed via property
                return;
            }

            RaisePropertyChanged(propertyName);
        }