void UpdateElevation()
 {
     if (Parent is AView view)
     {
         ElevationHelper.SetElevation(view, View);
     }
 }
Ejemplo n.º 2
0
        void SetUpNewElement(IndicatorView newElement)
        {
            if (newElement == null)
            {
                IndicatorView = null;
                return;
            }

            IndicatorView = newElement;

            IndicatorView.PropertyChanged += OnElementPropertyChanged;

            if (Tracker == null)
            {
                _visualElementTracker = new VisualElementTracker(this);
            }

            this.EnsureId();

            UpdateBackgroundColor();

            if (IndicatorView.IndicatorTemplate != null)
            {
                UpdateIndicatorTemplate();
            }
            else
            {
                UpdateItemsSource();
            }

            ElevationHelper.SetElevation(this, newElement);

            UpdateSelectedIndicator();
        }
Ejemplo n.º 3
0
        protected virtual void OnElementChanged(ElementChangedEventArgs <TElement> e)
        {
            var args = new VisualElementChangedEventArgs(e.OldElement, e.NewElement);

            // The list of event handlers can be changed inside the handlers. (ex.: are used CompressedLayout)
            // To avoid an exception, a copy of the handlers is called.
            var handlers = _elementChangedHandlers.ToArray();

            foreach (var handler in handlers)
            {
                handler(this, args);
            }

            ElementChanged?.Invoke(this, e);

            ElevationHelper.SetElevation(this, e.NewElement);
        }
Ejemplo n.º 4
0
        //todo: make virtual when unsealed
        void OnElementChanged(ElementChangedEventArgs <MediaElement> e)
        {
            if (e.OldElement != null)
            {
            }

            if (e.NewElement != null)
            {
                this.EnsureId();

                UpdateKeepScreenOn();
                UpdateLayoutParameters();
                UpdateShowPlaybackControls();
                UpdateSource();
                UpdateBackgroundColor();

                ElevationHelper.SetElevation(this, e.NewElement);
            }

            ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(e.OldElement, e.NewElement));
        }