public static object GetEnvironment(this ContextualObject contextualObject, View view, Type type, string key, bool cascades = true) => contextualObject.GetValue(key, contextualObject, view, ContextualObject.GetTypedStyleId(contextualObject, key), ContextualObject.GetTypedKey(type ?? contextualObject.GetType(), key), cascades);
//public static T SetEnvironment<T>(this T contextualObject, IDictionary<string, object> data, bool cascades = true) where T : ContextualObject //{ // foreach (var pair in data) // contextualObject.SetValue(pair.Key, pair.Value,cascades); // return contextualObject; //} public static T GetEnvironment <T>(this ContextualObject contextualObject, View view, string key, bool cascades = true) => contextualObject.GetEnvironment <T>(view, contextualObject.GetType(), key, cascades);