예제 #1
0
        public JsonCollection BuildParams(bool addInitialComma)
        {
            var optionList = new JsonCollection(addInitialComma);

            optionList.Add("backgroundColor", JavascriptHelper.GetStringFromColor(BackgroundColor), BackgroundColor != DefaultBackColor, typeof(string));
            optionList.Add("center", Center == null ? string.Empty : Center.ToStringNew(), Center != null);
            optionList.Add("disableDefaultUI", DisableDefaultUI, DisableDefaultUI != DefaultDisableDefaultUi, typeof(bool));
            optionList.Add("disableDoubleClickZoom", DisableDoubleClickZoom, DisableDoubleClickZoom != DefaultDisableDoubleClickZoom, typeof(bool));
            optionList.Add("draggable", Draggable, Draggable != DefaultDraggable, typeof(bool));
            optionList.Add("draggableCursor", DraggableCursor.ToString().ToLowerInvariant(), DraggableCursor != Cursor.None, typeof(string));
            optionList.Add("draggingCursor", DraggingCursor.ToString().ToLowerInvariant(), DraggingCursor != Cursor.None, typeof(string));
            optionList.Add("heading", Heading, Heading.HasValue);
            optionList.Add("keyboardShortcuts", KeyboardShortcuts, DisableDefaultUI || KeyboardShortcuts != DefaultKeyboardShortcuts, typeof(bool));
            // TODO :: MapMaker
            // optionList.Add("mapMaker", MapMaker, MapMaker != DefaultMapMaker, typeof(bool));
            if (MapTypeControl.HasValue)
            {
                optionList.Add <bool>("mapTypeControl", MapTypeControl.Value);
            }
            optionList.Add("mapTypeControlOptions", MapTypeControlOptions, MapTypeControlOptions != null);

            if (string.IsNullOrEmpty(CustomMapTypeId))
            {
                optionList.Add("mapTypeId", GetMapType(MapTypeId));
            }
            else
            {
                optionList.Add <string>("mapTypeId", CustomMapTypeId);
            }

            optionList.Add("maxZoom", MaxZoom, MaxZoom.HasValue);
            optionList.Add("minZoom", MinZoom, MinZoom.HasValue);
            optionList.Add("noClear", NoClear, NoClear != DefaultNoClear, typeof(bool));
            optionList.Add("overviewMapControl", OverviewMapControl, OverviewMapControl != DefaultOverviewMapControl, typeof(bool));
            optionList.Add("overviewMapControlOptions", OverviewMapControlOptions, OverviewMapControlOptions != null);
            optionList.Add("panControl", PanControl, PanControl != DefaultPanControl, typeof(bool));
            optionList.Add("panControlOptions", PanControlOptions, PanControlOptions != null);
            optionList.Add("rotateControl", RotateControl, RotateControl != DefaultRotateControl, typeof(bool));
            optionList.Add("rotateControlOptions", RotateControlOptions, RotateControlOptions != null);
            optionList.Add("scaleControl", ScaleControl, ScaleControl != DefaultScaleControl, typeof(bool));
            optionList.Add("scaleControlOptions", ScaleControlOptions, ScaleControlOptions != null);
            optionList.Add("scrollwheel", Scrollwheel, Scrollwheel != DefaultScrollwheel, typeof(bool));
            optionList.Add("streetView", StreetView != null, StreetView != null, typeof(bool));
            optionList.Add("streetViewControl", StreetViewControl, StreetViewControl != DefaultStreetViewControl, typeof(bool));
            optionList.Add("streetViewControlOptions", StreetViewControlOptions, StreetViewControlOptions != null);
            if (Styles.Count > 0)
            {
                optionList.Add("styles", MapTypeStyle.GetStyles(Styles));
            }
            optionList.Add("tilt", Tilt, Tilt.HasValue);
            optionList.Add("zoom", Zoom, Zoom.HasValue, typeof(int));
            optionList.Add("zoomControl", ZoomControl, ZoomControl != DefaultZoomControl, typeof(bool));
            optionList.Add("zoomControlOptions", ZoomControlOptions, ZoomControlOptions != null);

            return(optionList);
        }
예제 #2
0
        private void InitBindings()
        {
            BoolToVisibilityConverter boolToVisibilityConverter = new BoolToVisibilityConverter();

            ItemShadow.SetBinding(VisibilityProperty, new Binding(nameof(ItemShadowVisible))
            {
                Source = this, Mode = BindingMode.OneWay, Converter = boolToVisibilityConverter
            });
            DraggingCursor.SetBinding(Border.BackgroundProperty, new Binding(nameof(DraggingCursorBrush))
            {
                Source = this
            });
        }