/// <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); } } }
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(); }
/// <summary> /// Called when toggle value changes. /// </summary> public void ToggleValueChanged() { if (!IsToggleButton) { return; } if (ToggleValue) { SetState("Pressed"); } else { SetState(DefaultStateName); } ToggleClick?.Invoke(this, ToggleValue); }
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(); }