Example #1
0
        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
        {
            SwitchAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as SwitchAttributes;

            if (tempAttributes != null)
            {
                attributes = switchAttributes = tempAttributes;
                RelayoutRequest();
            }
        }
Example #2
0
        private void Initialize()
        {
            switchAttributes = attributes as SwitchAttributes;
            if (switchAttributes == null)
            {
                throw new Exception("Switch attribute parse error.");
            }

            switchAttributes.IsSelectable = true;
            CreateHandlerAnimation();
        }
Example #3
0
        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;
            }
        }
Example #4
0
 public Switch(SwitchAttributes attrs) : base(attrs)
 {
     Initialize();
 }