bool TryGetValue(IStyleKey key, out object value) { var idx = StyleSystem.LinearIndexFor(key); value = cachedValues[idx]; return(value != null); }
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); }
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); }
void Store(IStyleKey key, object value) { var idx = StyleSystem.LinearIndexFor(key); cachedValues[idx] = value; }