예제 #1
0
        /// <summary>
        /// Called when the element changes.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                if (fixedButton != null)
                {
                    fixedButton.PropertyChanged -= OnPropertyChanged;
                }
            }

            if (e.NewElement != null)
            {
                fixedButton = (FixedButton)Element;
                fixedButton.PropertyChanged += OnPropertyChanged;

                // Setup native butotn.
                nativeButton = new Android.Widget.Button(Context);
                nativeButton.SetOnTouchListener(this);
                SetNativeControl(nativeButton);
                SetDefaultValue();
            }
        }