void IEvaluableMarkupExtension.Initialize(IParserContext context)
    {
      _resource = ResourceDictionary.FindResourceInParserContext(_resourceKey, context) ?? FindResourceInTheme(_resourceKey, context);

      if (_resource == null)
        ServiceRegistration.Get<ILogger>().Error("StaticResourceMarkupExtension: Resource '{0}' not found", _resourceKey);
    }
        void IEvaluableMarkupExtension.Initialize(IParserContext context)
        {
            var           skinHeight = SkinContext.SkinResources.SkinHeight;
            List <string> fallbacks;

            if (!_fallbacks.TryGetValue(skinHeight, out fallbacks))
            {
                fallbacks = new List <string> {
                    string.Empty
                }
            }
            ;

            // First try all theme resources, then resources in parser context
            foreach (string fallback in fallbacks)
            {
                _resource = FindResourceInTheme(_resourceKey + fallback, context);
                if (_resource != null)
                {
                    break;
                }
            }
            if (_resource == null)
            {
                foreach (string fallback in fallbacks)
                {
                    _resource = ResourceDictionary.FindResourceInParserContext(_resourceKey + fallback, context);
                    if (_resource != null)
                    {
                        break;
                    }
                }
            }

            if (_resource == null)
            {
                ServiceRegistration.Get <ILogger>().Error("ResolutionResourceExtension: Resource '{0}' not found", _resourceKey);
            }
        }

        bool IEvaluableMarkupExtension.Evaluate(out object value)
        {
            value = _resource;
            return(_resource != null);
        }