Пример #1
0
        public TabAttributes(TabAttributes attributes) : base(attributes)
        {
            if (null == attributes)
            {
                return;
            }

            if (attributes.UnderLineAttributes != null)
            {
                UnderLineAttributes = attributes.UnderLineAttributes.Clone() as ViewAttributes;
            }

            if (attributes.TextAttributes != null)
            {
                TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
            }

            if (attributes.Space != null)
            {
                Space = new Vector4(attributes.Space.X, attributes.Space.Y, attributes.Space.Z, attributes.Space.W);
            }
            else
            {
                Space = new Vector4(0, 0, 0, 0);
            }
            ItemGap           = attributes.ItemGap;
            IsNatureTextWidth = attributes.IsNatureTextWidth;
        }
Пример #2
0
        private void Initialize()
        {
            tabAttributes = attributes as TabAttributes;
            if (tabAttributes == null)
            {
                throw new Exception("Tab attribute parse error.");
            }

            ApplyAttributes(this, tabAttributes);
            LayoutDirectionChanged += OnLayoutDirectionChanged;
        }
Пример #3
0
        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
        {
            TabAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as TabAttributes;

            if (tempAttributes != null)
            {
                tempAttributes.IsNatureTextWidth = tabAttributes.IsNatureTextWidth; // keep IsNatureTextWidth as original
                attributes = tabAttributes = tempAttributes;
                RelayoutRequest();
            }
        }
Пример #4
0
 public Tab(TabAttributes attributes) : base(attributes)
 {
     Initialize();
 }