Ejemplo n.º 1
0
        bool TryGetValue(IStyleKey key, out object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            value = cachedValues[idx];
            return(value != null);
        }
Ejemplo n.º 2
0
        public bool SetValue(IStyleKey key, object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            cachedValues[idx] = null;
            if (elementStyle.SetValue(key, value))
            {
                if (key.Inherit || InheritMarker.IsInheritMarker(value))
                {
                    // inherited styles are distributed to child elements, so we need to explicitly clear them all.
                    self.InvalidateStyle(false);
                }

                self.InvalidateLayout();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
        void Store(IStyleKey key, object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            cachedValues[idx] = value;
        }