Inheritance: Xamarin.Forms.View
Example #1
0
        internal void RemoveEvents(UnifiedMap map)
        {
            MessagingCenter.Unsubscribe <UnifiedMap, Tuple <MapRegion, bool> >(this, UnifiedMap.MessageMapMoveToRegion);

            RemovePinEvents();
            RemoveOverlayEvents();
        }
Example #2
0
        internal void RegisterEvents(UnifiedMap map)
        {
            RegisterPinEvents(map);
            RegisterOverlayEvents(map);

            MessagingCenter.Subscribe <UnifiedMap, Tuple <MapRegion, bool> >(this, UnifiedMap.MessageMapMoveToRegion,
                                                                             (unifiedMap, span) => MoveToRegion(span.Item1, span.Item2));
        }
Example #3
0
        internal void RemoveEvents(UnifiedMap map)
        {
            MessagingCenter.Unsubscribe <UnifiedMap, Tuple <MapRegion, bool> >(this, map.GetMoveToRegionMessage());
            MessagingCenter.Unsubscribe <UnifiedMap, bool>(this, map.GetMoveToUserLocationMessage());

            RemovePinEvents();
            RemoveOverlayEvents();
        }
Example #4
0
        internal void RegisterEvents(UnifiedMap map)
        {
            RegisterPinEvents(map);
            RegisterOverlayEvents(map);

            MessagingCenter.Subscribe <UnifiedMap, Tuple <MapRegion, bool> >(this, map.GetMoveToRegionMessage(),
                                                                             (unifiedMap, span) => MoveToRegion(span.Item1, span.Item2));

            MessagingCenter.Subscribe <UnifiedMap, bool>(this, map.GetMoveToUserLocationMessage(),
                                                         (unifiedMap, animated) => MoveToUserLocation(animated));
        }
Example #5
0
        internal void RegisterOverlayEvents(UnifiedMap map)
        {
            var overlaysObservable = map.Overlays as INotifyCollectionChanged;

            if (overlaysObservable != null && overlaysObservable != _observableOverlays)
            {
                if (_observableOverlays != null)
                {
                    _observableOverlays.CollectionChanged -= OnOverlaysCollectionChanged;
                }

                overlaysObservable.CollectionChanged += OnOverlaysCollectionChanged;
                _observableOverlays = overlaysObservable;
            }
        }
Example #6
0
        internal void RegisterPinEvents(UnifiedMap map)
        {
            var pinsObservable = map.Pins as INotifyCollectionChanged;

            if (pinsObservable != null && pinsObservable != _observablePins)
            {
                if (_observablePins != null)
                {
                    _observablePins.CollectionChanged -= OnPinsCollectionChanged;
                }

                pinsObservable.CollectionChanged += OnPinsCollectionChanged;
                _observablePins = pinsObservable;
            }
        }
Example #7
0
 internal static string GetMoveToUserLocationMessage(this UnifiedMap map)
 {
     return($"{MessageMapMoveToUserLocation}-{map.GetHashCode()}");
 }
        internal void RemoveEvents(UnifiedMap map)
        {
            MessagingCenter.Unsubscribe<UnifiedMap, Tuple<MapRegion, bool>>(this, UnifiedMap.MessageMapMoveToRegion);

            RemovePinEvents();
            RemoveOverlayEvents();
        }
        internal void RegisterPinEvents(UnifiedMap map)
        {
            var pinsObservable = map.Pins as INotifyCollectionChanged;
            if (pinsObservable != null && pinsObservable != _observablePins)
            {
                if (_observablePins != null)
                {
                    _observablePins.CollectionChanged -= OnPinsCollectionChanged;
                }

                pinsObservable.CollectionChanged += OnPinsCollectionChanged;
                _observablePins = pinsObservable;
            }
        }
        internal void RegisterOverlayEvents(UnifiedMap map)
        {
            var overlaysObservable = map.Overlays as INotifyCollectionChanged;
            if (overlaysObservable != null && overlaysObservable != _observableOverlays)
            {
                if (_observableOverlays != null)
                {
                    _observableOverlays.CollectionChanged -= OnOverlaysCollectionChanged;
                }

                overlaysObservable.CollectionChanged += OnOverlaysCollectionChanged;
                _observableOverlays = overlaysObservable;
            }
        }
        internal void RegisterEvents(UnifiedMap map)
        {
            RegisterPinEvents(map);
            RegisterOverlayEvents(map);

            MessagingCenter.Subscribe<UnifiedMap, Tuple<MapRegion, bool>>(this, UnifiedMap.MessageMapMoveToRegion,
                (unifiedMap, span) => MoveToRegion(span.Item1, span.Item2));
        }