예제 #1
0
        bool TryGetValue(IStyleKey key, out object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            value = cachedValues[idx];
            return(value != null);
        }
예제 #2
0
 public bool IsExplicitlyInherited(IStyleKey key)
 {
     if (!StyleSystem.IsRegisteredKey(key))
     {
         throw new ArgumentException($"StyleKey {key} is not registered here.");
     }
     if (elementStyle.IsExplicitlyInherited(key))
     {
         return(true);
     }
     if (ResolvedStyles.IsExplicitlyInherited(key))
     {
         return(true);
     }
     return(false);
 }
예제 #3
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);
        }
예제 #4
0
        void Store(IStyleKey key, object value)
        {
            var idx = StyleSystem.LinearIndexFor(key);

            cachedValues[idx] = value;
        }