Exemple #1
0
        /// <summary>
        /// Called when toggle value changes.
        /// </summary>
        public void ToggleValueChanged(bool triggerToggleClick = true)
        {
            if (!IsToggleButton)
            {
                return;
            }

            if (ToggleValue)
            {
                SetState("Pressed");
            }
            else
            {
                SetState(DefaultStateName);
            }

            if (triggerToggleClick)
            {
                ToggleClick?.Invoke(this, ToggleValue);
                if (ToggleValue)
                {
                    ToggleOn?.Invoke(this, null);
                }
                else
                {
                    ToggleOff?.Invoke(this, null);
                }
            }
        }
Exemple #2
0
        public TabHeader(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? TabHeaderTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            ToggleClick.RegisterHandler(this, "TabToggleClick");
            this.AfterInitializeInternal();
        }
Exemple #3
0
        /// <summary>
        /// Called when toggle value changes.
        /// </summary>
        public void ToggleValueChanged()
        {
            if (!IsToggleButton)
            {
                return;
            }

            if (ToggleValue)
            {
                SetState("Pressed");
            }
            else
            {
                SetState(DefaultStateName);
            }

            ToggleClick?.Invoke(this, ToggleValue);
        }
Exemple #4
0
 public TabHeader(View parent, View layoutParent = null, string id = null, Template template = null, Action <View> initializer = null) :
     base(parent, layoutParent, id, template ?? TabHeaderTemplates.Default, initializer)
 {
     ToggleClick.RegisterHandler(this, "TabToggleClick");
     this.AfterInitializeInternal();
 }