void UpdateElevation() { if (Parent is AView view) { ElevationHelper.SetElevation(view, View); } }
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(); UpdateHidesForSinglePage(); }
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); }
protected virtual void OnElementChanged(ElementChangedEventArgs <RadioButton> e) { if (e.NewElement != null && !_isDisposed) { this.EnsureId(); _textColorSwitcher = new Lazy <TextColorSwitcher>( () => new TextColorSwitcher(TextColors, e.NewElement.UseLegacyColorManagement())); UpdateFont(); UpdateTextColor(); UpdateInputTransparent(); UpdateBackgroundColor(); UpdateIsChecked(); UpdateContent(); ElevationHelper.SetElevation(this, e.NewElement); } ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(e.OldElement, e.NewElement)); }