public bool TryGet <T>(out T style) where T : IStyle { style = (T)_styles.Values.FirstOrDefault(val => val is T); if (ReferenceEquals(null, style)) { style = (T)_styleSheet.GetStyles(_subject).Values.FirstOrDefault(val => val is T); if (ReferenceEquals(null, style)) { style = (T)DefaultStyles[typeof(T)]; } return(false); } return(true); }