Exemplo n.º 1
0
        public override void FinishInitialization(IParserContext context)
        {
            base.FinishInitialization(context);
            string targetProperty = Storyboard.GetTargetProperty(this);

            _propertyExpression = String.IsNullOrEmpty(targetProperty) ? null : PathExpression.Compile(context, targetProperty);
        }
        public override void FinishInitialization(IParserContext context)
        {
            base.FinishInitialization(context);
            string path = Path ?? "";

            _compiledPath = string.IsNullOrEmpty(path) ? null : PathExpression.Compile(context, path);
        }
Exemplo n.º 3
0
 void IEvaluableMarkupExtension.Initialize(IParserContext context)
 {
     if (_path == null)
     {
         throw new XamlBindingException("CommandBaseMarkupExtension: Path mustn't be null");
     }
     _compiledPath = PathExpression.Compile(context, _path);
 }
Exemplo n.º 4
0
 void IInitializable.FinishInitialization(IParserContext context)
 {
     if (_path == null)
     {
         throw new XamlBindingException("{0}: Path mustn't be null", GetType().Name);
     }
     _compiledPath = PathExpression.Compile(context, _path);
     ResourceDictionary.RegisterUnmodifiableResourceDuringParsingProcess(this, context);
 }
        void IEvaluableMarkupExtension.Initialize(IParserContext context)
        {
            string localName;
            string namespaceURI;

            context.LookupNamespace(_typeName, out localName, out namespaceURI);
            Type            type = context.GetNamespaceHandler(namespaceURI).GetElementType(localName);
            IDataDescriptor result;

            try
            {
                if (PathExpression.Compile(context, _staticMemberName).Evaluate(
                        new ValueDataDescriptor(type), out result))
                {
                    _value = result.Value;
                }
            }
            catch (XamlBindingException e)
            {
                ServiceRegistration.Get <ILogger>().Warn("Error evaluating Static markup", e);
            }
        }