private bool TryGetDeferredAssembler(MutableXamlMember xamlMember, out IDeferredLoader loader)
        {
            Guard.ThrowIfNull(xamlMember, nameof(xamlMember));

            var propInfo = xamlMember.DeclaringType.UnderlyingType.GetRuntimeProperty(xamlMember.Name);

            if (propInfo != null)
            {
                var success = mapping.TryGetMapping(propInfo, out loader);
                return(success);
            }

            loader = null;
            return(false);
        }
Ejemplo n.º 2
0
        private static XamlMember GetMember(MutableXamlMember member, XamlSchemaContext context)
        {
            var declaringType = ToWpf(member.DeclaringType, context);

            if (!member.IsAttachable)
            {
                var xamlMember = declaringType.GetMember(member.Name);
                return(new XamlMemberAdapter(xamlMember, context));
            }
            else
            {
                var xamlMember = declaringType.GetAttachableMember(member.Name);
                return(new XamlMemberAdapter(xamlMember, context, member.Name, xamlMember.Invoker.UnderlyingGetter, xamlMember.Invoker.UnderlyingSetter));
            }
        }
Ejemplo n.º 3
0
        private static XamlMember GetMember(MutableXamlMember member, XamlSchemaContext context)
        {
            var declaringType = ToWpf(member.DeclaringType, context);

            if (!member.IsAttachable)
            {
                var xamlMember = declaringType.GetMember(member.Name);
                return new XamlMemberAdapter(xamlMember, context);
            }
            else
            {
                var xamlMember = declaringType.GetAttachableMember(member.Name);
                return new XamlMemberAdapter(xamlMember, context, member.Name, xamlMember.Invoker.UnderlyingGetter, xamlMember.Invoker.UnderlyingSetter);
            }
        }
Ejemplo n.º 4
0
 private bool OnSetValue(object instance, MutableXamlMember parentProperty, object value)
 {
     if (XamlSetValueHandler == null)
     {
         return false;
     }
     var e = new XamlSetValueEventArgs(parentProperty, value);
     XamlSetValueHandler(instance, e);
     return e.Handled;
 }
Ejemplo n.º 5
0
 public PerspexXamlMemberValuePlugin(MutableXamlMember xamlMember)
     : base(xamlMember)
 {
     _xamlMember = xamlMember;
 }
Ejemplo n.º 6
0
 private static object GetValueTuple(object instance, MutableXamlMember member)
 {
     var xamlMemberBase = member;
     return xamlMemberBase.GetValue(instance);
 }
Ejemplo n.º 7
0
 public XamlSetValueEventArgs(MutableXamlMember member, object value)
 {
     Value  = value;
     Member = member;
 }
        private bool TryGetDeferredAssembler(MutableXamlMember xamlMember, out IDeferredLoader loader)
        {
            Guard.ThrowIfNull(xamlMember, nameof(xamlMember));

            var propInfo = xamlMember.DeclaringType.UnderlyingType.GetRuntimeProperty(xamlMember.Name);
            if  (propInfo!=null)
            {
                var success = mapping.TryGetMapping(propInfo, out loader);
                return success;
            }

            loader = null;
            return false;
        }
Ejemplo n.º 9
0
 public XamlSetValueEventArgs(MutableXamlMember member, object value)
 {
     Value = value;
     Member = member;
 }
Ejemplo n.º 10
0
 public MemberValuePlugin(MutableXamlMember xamlMember) : base(xamlMember)
 {
     this.xamlMember = xamlMember;
 }
Ejemplo n.º 11
0
        private void ApplyPropertyValue(StateBag bag, MutableXamlMember parentProperty, object value, bool onParent)
        {
            var instance = onParent ? bag.Parent.Instance : bag.Current.Instance;

            var isSetExternally = OnSetValue(instance, parentProperty, value);

            if (!isSetExternally)
            {
                TypeOperations.SetValue(instance, parentProperty, value);
            }
        }
Ejemplo n.º 12
0
 private object GetValueOfMemberFromParentInstance(MutableXamlMember property)
 {
     var parentInstance = bag.Parent.Instance;
     var valueOfProperty = TypeOperations.GetValue(parentInstance, property);
     return valueOfProperty;
 }
Ejemplo n.º 13
0
 public MemberValuePlugin(MutableXamlMember xamlMember)
     : base(xamlMember)
 {
     this.xamlMember = xamlMember;
 }
Ejemplo n.º 14
0
 public MemberNodesBlock(XamlInstruction headingInstruction)
 {
     member = (MutableXamlMember)headingInstruction.Member;
 }
Ejemplo n.º 15
0
        private static object GetValueTuple(object instance, MutableXamlMember member)
        {
            var xamlMemberBase = member;

            return(xamlMemberBase.GetValue(instance));
        }
Ejemplo n.º 16
0
 public static void SetValue(object instance, MutableXamlMember parentProperty, object value)
 {
     parentProperty.XamlMemberValueConnector.SetValue(instance, value);
 }
Ejemplo n.º 17
0
 public static object GetValue(object parentInstance, MutableXamlMember property)
 {
     return property.XamlMemberValueConnector.GetValue(parentInstance);
 }