Exemple #1
0
        public override void UpdateBindings()
        {
            base.UpdateBindings();

            if (_dstView != null)
            {
                var props = _dstView.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
                DstProps = props.Where(prop => prop.GetSetMethod(false) != null &&
                                       prop.GetSetMethod(false) != null &&
                                       !prop.GetCustomAttributes(typeof(ObsoleteAttribute), true).Any()
                                       ).Select(e => new BindablePropertyInfo {
                    PropertyName = e.Name, PropertyType = e.PropertyType.Name
                }).ToList();
            }

            if (!string.IsNullOrEmpty(ViewModelName))
            {
                var props = ViewModelProvider.GetViewModelFields(ViewModelName);
                SrcProps = props.Where(prop =>
                                       prop.FieldType.IsAssignableToGenericType(typeof(Reactive.ReactiveProperty <>)) &&
                                       !prop.GetCustomAttributes(typeof(ObsoleteAttribute), true)
                                       .Any())
                           .Select(e => new BindablePropertyInfo(e.Name, e.FieldType.IsGenericType ? e.FieldType.GetGenericArguments()[0].Name : e.FieldType.BaseType.GetGenericArguments()[0].Name)).ToList();
                SrcProps.AddRange(GetExtraViewModelProperties(props));
            }
        }
        public override void UpdateBindings()
        {
            base.UpdateBindings();

            if (!string.IsNullOrEmpty(ViewModelName))
            {
                var props = ViewModelProvider.GetViewModelFields(ViewModelName);

                SrcCollections = props.Where(prop =>
                                             prop.FieldType.IsAssignableToGenericType(typeof(ReactiveCollection <>)) &&
                                             !prop.GetCustomAttributes(typeof(ObsoleteAttribute), true).Any()
                                             ).Select(e => new BindablePropertyInfo(e.Name, e.FieldType.GenericTypeArguments[0].Name)).ToList();
            }
        }