示例#1
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (this.IsDisposed())
            {
                return;
            }

            ElementPropertyChanged?.Invoke(this, e);

            if (Control?.LayoutParameters == null && _hasLayoutOccurred)
            {
                return;
            }

            if (e.PropertyName == Frame.HasShadowProperty.PropertyName)
            {
                UpdateShadow();
            }
            else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
            {
                UpdateBackgroundColor();
            }
            else if (e.PropertyName == VisualElement.BackgroundProperty.PropertyName)
            {
                UpdateBackground();
            }
            else if (e.PropertyName == Frame.CornerRadiusProperty.PropertyName)
            {
                UpdateCornerRadius();
            }
            else if (e.PropertyName == Frame.BorderColorProperty.PropertyName)
            {
                UpdateBorderColor();
            }
            else if (e.Is(Xamarin.Forms.Layout.IsClippedToBoundsProperty))
            {
                UpdateClippedToBounds();
            }
        }
示例#2
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (this.IsDisposed())
            {
                return;
            }

            if (e.PropertyName == CheckBox.ColorProperty.PropertyName)
            {
                UpdateOnColor();
            }
            else if (e.PropertyName == CheckBox.IsCheckedProperty.PropertyName)
            {
                UpdateIsChecked();
            }
            else if (e.PropertyName == CheckBox.BackgroundColorProperty.PropertyName)
            {
                UpdateBackgroundColor();
            }

            ElementPropertyChanged?.Invoke(this, e);
        }
示例#3
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs changedProperty)
        {
            ElementPropertyChanged?.Invoke(this, changedProperty);

            if (changedProperty.Is(Xamarin.Forms.ItemsView.ItemsSourceProperty))
            {
                UpdateItemsSource();
            }
            else if (changedProperty.Is(Xamarin.Forms.ItemsView.ItemTemplateProperty))
            {
                GetRecycledViewPool().Clear();
                UpdateAdapter();
            }
            else if (changedProperty.Is(VisualElement.BackgroundColorProperty))
            {
                UpdateBackgroundColor();
            }
            else if (changedProperty.Is(VisualElement.FlowDirectionProperty))
            {
                UpdateFlowDirection();
            }
            else if (changedProperty.IsOneOf(Xamarin.Forms.ItemsView.EmptyViewProperty,
                                             Xamarin.Forms.ItemsView.EmptyViewTemplateProperty))
            {
                UpdateEmptyView();
            }
            else if (changedProperty.Is(Xamarin.Forms.ItemsView.HorizontalScrollBarVisibilityProperty))
            {
                UpdateHorizontalScrollBarVisibility();
            }
            else if (changedProperty.Is(Xamarin.Forms.ItemsView.VerticalScrollBarVisibilityProperty))
            {
                UpdateVerticalScrollBarVisibility();
            }
            else if (changedProperty.Is(Xamarin.Forms.ItemsView.ItemsUpdatingScrollModeProperty))
            {
                UpdateItemsUpdatingScrollMode();
            }
        }
示例#4
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs changedProperty)
        {
            ElementPropertyChanged?.Invoke(this, changedProperty);

            // TODO hartez 2018/10/24 10:41:55 If the ItemTemplate changes from set to null, we need to make sure to clear the recyclerview pool

            if (changedProperty.Is(ItemsView.ItemsSourceProperty))
            {
                UpdateItemsSource();
            }
            else if (changedProperty.Is(VisualElement.BackgroundColorProperty))
            {
                UpdateBackgroundColor();
            }
            else if (changedProperty.Is(VisualElement.FlowDirectionProperty))
            {
                UpdateFlowDirection();
            }
            else if (changedProperty.IsOneOf(ItemsView.EmptyViewProperty, ItemsView.EmptyViewTemplateProperty))
            {
                UpdateEmptyView();
            }
            else if (changedProperty.Is(ItemsView.ItemSizingStrategyProperty))
            {
                UpdateAdapter();
            }
            else if (changedProperty.Is(ItemsView.HorizontalScrollBarVisibilityProperty))
            {
                UpdateHorizontalScrollBarVisibility();
            }
            else if (changedProperty.Is(ItemsView.VerticalScrollBarVisibilityProperty))
            {
                UpdateVerticalScrollBarVisibility();
            }
            else if (changedProperty.Is(ItemsView.ItemsUpdatingScrollModeProperty))
            {
                UpdateItemsUpdatingScrollMode();
            }
        }
		void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
		{
			ElementPropertyChanged?.Invoke(this, e);
			if (e.PropertyName == "Flyout")
				UpdateFlyout();
			else if (e.PropertyName == "Detail")
				UpdateDetail();
			else if (e.PropertyName == FlyoutPage.IsGestureEnabledProperty.PropertyName)
				SetGestureState();
			else if (e.PropertyName == FlyoutPage.IsPresentedProperty.PropertyName)
			{
				_isPresentingFromCore = true;
				Presented = Element.IsPresented;
				_isPresentingFromCore = false;
			}
			else if (e.PropertyName == Page.BackgroundImageSourceProperty.PropertyName)
				UpdateBackgroundImage(Element);
			else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
				UpdateBackgroundColor(Element);
			else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
				UpdateFlowDirection();
		}
示例#6
0
        void OnElementPropertyChanged(object sender, PropertyChangedEventArgs changedProperty)
        {
            ElementPropertyChanged?.Invoke(this, changedProperty);

            // TODO hartez 2018/10/24 10:41:55 If the ItemTemplate changes between set and null, we need to make sure to clear the recyclerview pool

            if (changedProperty.Is(ItemsView.ItemsSourceProperty))
            {
                UpdateItemsSource();
            }
            else if (changedProperty.Is(VisualElement.BackgroundColorProperty))
            {
                UpdateBackgroundColor();
            }
            else if (changedProperty.Is(VisualElement.FlowDirectionProperty))
            {
                UpdateFlowDirection();
            }
            else if (changedProperty.IsOneOf(ItemsView.EmptyViewProperty, ItemsView.EmptyViewTemplateProperty))
            {
                UpdateEmptyView();
            }
        }
示例#7
0
        void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == Button.TextProperty.PropertyName)
            {
                UpdateText();
            }
            else if (e.PropertyName == Button.TextColorProperty.PropertyName)
            {
                UpdateTextColor();
            }
            else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
            {
                UpdateIsEnabled();
            }
            else if (e.PropertyName == Button.FontProperty.PropertyName)
            {
                UpdateFont();
            }
            else if (e.PropertyName == Button.ImageProperty.PropertyName)
            {
                UpdateBitmap();
            }
            else if (e.PropertyName == VisualElement.IsVisibleProperty.PropertyName)
            {
                UpdateText();
            }
            else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
            {
                UpdateInputTransparent();
            }
            else if (e.PropertyName == Button.PaddingProperty.PropertyName)
            {
                UpdatePadding();
            }

            ElementPropertyChanged?.Invoke(this, e);
        }
示例#8
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs changedProperty)
        {
            ElementPropertyChanged?.Invoke(this, changedProperty);

            if (changedProperty.Is(IndicatorView.IndicatorTemplateProperty))
            {
                UpdateIndicatorTemplate();
            }
            else if (changedProperty.IsOneOf(IndicatorView.IndicatorsShapeProperty,
                                             IndicatorView.IndicatorColorProperty,
                                             IndicatorView.IndicatorSizeProperty,
                                             IndicatorView.SelectedIndicatorColorProperty))
            {
                ResetIndicators();
            }
            else if (changedProperty.Is(VisualElement.BackgroundColorProperty))
            {
                UpdateBackgroundColor();
            }
            else if (changedProperty.Is(IndicatorView.PositionProperty))
            {
                UpdateSelectedIndicator();
            }
            else if (changedProperty.Is(IndicatorView.CountProperty))
            {
                UpdateItemsSource();
            }
            else if (changedProperty.Is(IndicatorView.MaximumVisibleProperty))
            {
                UpdateIndicatorCount();
                ResetIndicators();
            }
            else if (changedProperty.PropertyName == IndicatorView.HideSingleProperty.PropertyName)
            {
                UpdateHidesForSinglePage();
            }
        }
示例#9
0
        protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
            {
                UpdateBackgroundColor();
            }
            else if (e.PropertyName == AutomationProperties.HelpTextProperty.PropertyName)
            {
                SetContentDescription();
            }
            else if (e.PropertyName == AutomationProperties.NameProperty.PropertyName)
            {
                SetContentDescription();
            }
            else if (e.PropertyName == AutomationProperties.IsInAccessibleTreeProperty.PropertyName)
            {
                SetFocusable();
            }
            else if (e.PropertyName == VisualElement.InputTransparentProperty.PropertyName)
            {
                UpdateInputTransparent();
            }
            else if (e.PropertyName == Xamarin.Forms.Layout.CascadeInputTransparentProperty.PropertyName)
            {
                UpdateInputTransparentInherited();
            }
            else if (e.PropertyName == VisualElement.IsTabStopProperty.PropertyName)
            {
                UpdateTabStop();
            }
            else if (e.PropertyName == VisualElement.TabIndexProperty.PropertyName)
            {
                UpdateTabIndex();
            }

            ElementPropertyChanged?.Invoke(this, e);
        }
示例#10
0
        void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            ElementPropertyChanged?.Invoke(this, e);

            if (e.PropertyName == "Content")
            {
                LoadContent();
            }
            else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
            {
                UpdateBackgroundColor();
            }
            else if (e.PropertyName == VisualElement.BackgroundProperty.PropertyName)
            {
                UpdateBackground();
            }
            else if (e.PropertyName == ScrollView.OrientationProperty.PropertyName)
            {
                UpdateOrientation();
            }
            else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
            {
                UpdateIsEnabled();
            }
            else if (e.PropertyName == ScrollView.HorizontalScrollBarVisibilityProperty.PropertyName)
            {
                UpdateHorizontalScrollBarVisibility();
            }
            else if (e.PropertyName == ScrollView.VerticalScrollBarVisibilityProperty.PropertyName)
            {
                UpdateVerticalScrollBarVisibility();
            }
            else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
            {
                UpdateFlowDirection();
            }
        }
示例#11
0
        void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            ElementPropertyChanged?.Invoke(this, e);

            if (e.PropertyName == Label.HorizontalTextAlignmentProperty.PropertyName || e.PropertyName == Label.VerticalTextAlignmentProperty.PropertyName)
            {
                UpdateGravity();
            }
            else if (e.PropertyName == Label.TextColorProperty.PropertyName)
            {
                UpdateText();
            }
            else if (e.PropertyName == Label.FontProperty.PropertyName)
            {
                UpdateText();
            }
            else if (e.PropertyName == Label.LineBreakModeProperty.PropertyName)
            {
                UpdateLineBreakMode();
            }
            else if (e.PropertyName == Label.TextDecorationsProperty.PropertyName)
            {
                UpdateTextDecorations();
            }
            else if (e.PropertyName == Label.TextProperty.PropertyName || e.PropertyName == Label.FormattedTextProperty.PropertyName)
            {
                UpdateText();
            }
            else if (e.PropertyName == Label.LineHeightProperty.PropertyName)
            {
                UpdateLineHeight();
            }
            else if (e.PropertyName == Label.MaxLinesProperty.PropertyName)
            {
                UpdateMaxLines();
            }
        }
示例#12
0
 void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     ElementPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(e.PropertyName));
 }
        private void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            var specializedArgs = new ElementPropertyChangedEventArgs <T>((T)sender, e.PropertyName);

            ElementPropertyChanged?.Invoke(this, specializedArgs);
        }
示例#14
0
        protected void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == Entry.PlaceholderProperty.PropertyName)
            {
                Hint = Entry.Placeholder;
            }
            else if (e.PropertyName == Entry.IsPasswordProperty.PropertyName)
            {
                UpdateInputType();
            }
            else if (e.PropertyName == Entry.TextProperty.PropertyName)
            {
                if (_textInputEditText.Text != Entry.Text)
                {
                    _textInputEditText.Text = Entry.Text;
                    if (IsFocused)
                    {
                        _textInputEditText.SetSelection(_textInputEditText.Text.Length);
                        this.ShowKeyboard();
                    }
                }
            }
            else if (e.PropertyName == Entry.TextColorProperty.PropertyName)
            {
                UpdateColor();
            }
            else if (e.PropertyName == InputView.KeyboardProperty.PropertyName)
            {
                UpdateInputType();
            }
            else if (e.PropertyName == InputView.IsSpellCheckEnabledProperty.PropertyName)
            {
                UpdateInputType();
            }
            else if (e.PropertyName == Entry.IsTextPredictionEnabledProperty.PropertyName)
            {
                UpdateInputType();
            }
            else if (e.PropertyName == Entry.HorizontalTextAlignmentProperty.PropertyName)
            {
                UpdateAlignment();
            }
            else if (e.PropertyName == Entry.FontAttributesProperty.PropertyName)
            {
                UpdateFont();
            }
            else if (e.PropertyName == Entry.FontFamilyProperty.PropertyName)
            {
                UpdateFont();
            }
            else if (e.PropertyName == Entry.FontSizeProperty.PropertyName)
            {
                UpdateFont();
            }
            else if (e.PropertyName == Entry.PlaceholderColorProperty.PropertyName)
            {
                UpdatePlaceholderColor(true);
            }
            else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
            {
                UpdateAlignment();
            }
            else if (e.PropertyName == InputView.MaxLengthProperty.PropertyName)
            {
                UpdateMaxLength();
            }
            else if (e.PropertyName == PlatformConfiguration.AndroidSpecific.Entry.ImeOptionsProperty.PropertyName)
            {
                UpdateImeOptions();
            }
            else if (e.PropertyName == Entry.ReturnTypeProperty.PropertyName)
            {
                UpdateReturnType();
            }
            else if (e.PropertyName == Entry.SelectionLengthProperty.PropertyName)
            {
                UpdateCursorSelection();
            }
            else if (e.PropertyName == Entry.CursorPositionProperty.PropertyName)
            {
                UpdateCursorSelection();
            }
            else if (e.PropertyName == Entry.BackgroundColorProperty.PropertyName)
            {
                UpdateBackgroundColor();
            }

            ElementPropertyChanged?.Invoke(this, e);
        }
 protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     ElementPropertyChanged?.Invoke(this, e);
 }
示例#16
0
 private void Project_ElementPropertyChanged(object sender, ElementValueChangedEventArgs e)
 {
     ElementPropertyChanged?.Invoke(this, e);
     UndoRedoManager.ProcessElementPropertyChanged(e);
 }
示例#17
0
 private void RaiseElementPropertyChanged(PropertyChangedEventArgs args)
 {
     ElementPropertyChanged?.Invoke(this, args);
     OnElementPropertyChanged(this, args);
 }