protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) { SwitchAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as SwitchAttributes; if (tempAttributes != null) { attributes = switchAttributes = tempAttributes; RelayoutRequest(); } }
private void Initialize() { switchAttributes = attributes as SwitchAttributes; if (switchAttributes == null) { throw new Exception("Switch attribute parse error."); } switchAttributes.IsSelectable = true; CreateHandlerAnimation(); }
public SwitchAttributes(SwitchAttributes attributes) : base(attributes) { if (attributes == null) { return; } if (attributes.SwitchHandlerImageAttributes != null) { SwitchHandlerImageAttributes = attributes.SwitchHandlerImageAttributes.Clone() as ImageAttributes; } if (attributes.SwitchBackgroundImageAttributes != null) { SwitchBackgroundImageAttributes = attributes.SwitchBackgroundImageAttributes.Clone() as ImageAttributes; } }
public Switch(SwitchAttributes attrs) : base(attrs) { Initialize(); }