Example #1
0
        private void TileLayersPropertyChanged(TileLayerCollection oldTileLayers, TileLayerCollection newTileLayers)
        {
            tileContainer.ClearTileLayers();

            if (oldTileLayers != null)
            {
                oldTileLayers.CollectionChanged -= TileLayerCollectionChanged;
            }

            if (newTileLayers != null)
            {
                newTileLayers.CollectionChanged += TileLayerCollectionChanged;
                tileContainer.AddTileLayers(0, newTileLayers);

                var firstTileLayer = TileLayers.FirstOrDefault();

                if (TileLayer != firstTileLayer)
                {
                    TileLayer = firstTileLayer;
                }
            }
            else
            {
                TileLayer = null;
            }
        }
Example #2
0
        public MapBase()
        {
            SetParentMap();

            TileLayers = new TileLayerCollection();
            Initialize();

            Loaded += OnLoaded;
        }
Example #3
0
        public MapBase()
        {
            SetParentMap();

            TileLayers = new TileLayerCollection();
            InternalChildren.Add(tileContainer);
            Initialize();

            Loaded += OnLoaded;
        }
Example #4
0
        private void TileLayerPropertyChanged(TileLayer tileLayer)
        {
            if (tileLayer != null)
            {
                if (TileLayers == null)
                {
                    TileLayers = new TileLayerCollection();
                }

                if (TileLayers.Count == 0)
                {
                    TileLayers.Add(tileLayer);
                }
                else if (TileLayers[0] != tileLayer)
                {
                    TileLayers[0] = tileLayer;
                }
            }

            if (tileLayer != null && tileLayer.Background != null)
            {
                if (storedBackground == null)
                {
                    storedBackground = Background;
                }

                Background = tileLayer.Background;
            }
            else if (storedBackground != null)
            {
                Background       = storedBackground;
                storedBackground = null;
            }

            if (tileLayer != null && tileLayer.Foreground != null)
            {
                if (storedForeground == null)
                {
                    storedForeground = Foreground;
                }

                Foreground = tileLayer.Foreground;
            }
            else if (storedForeground != null)
            {
                Foreground       = storedForeground;
                storedForeground = null;
            }
        }
Example #5
0
        private void TileLayersPropertyChanged(TileLayerCollection oldTileLayers, TileLayerCollection newTileLayers)
        {
            tileContainer.ClearTileLayers();

            if (oldTileLayers != null)
            {
                oldTileLayers.CollectionChanged -= TileLayerCollectionChanged;
            }

            if (newTileLayers != null)
            {
                newTileLayers.CollectionChanged += TileLayerCollectionChanged;
                tileContainer.AddTileLayers(0, newTileLayers);
            }

            UpdateTileLayer();
        }