Пример #1
0
        public bool TryGetResource(object resourceKey, out object value)
        {
            if ((Resources == null || !Resources.TryGetValue(resourceKey, out value)) &&
                (ResourceInheritanceParent == null || !ResourceInheritanceParent.TryGetResource(resourceKey, out value)))
            {
                value = null;
                return(false);
            }

            return(true);
        }
Пример #2
0
        private bool TryResolveResource(object resourceKey, out object value)
        {
            if (Resources != null && Resources.TryGetValue(resourceKey, out value))
            {
                return(true);
            }

            if (ResourceInheritanceParent != null && ResourceInheritanceParent.TryGetResource(resourceKey, out value))
            {
                return(true);
            }

            value = null;
            return(false);
        }