public IMvxTargetBinding CreateBinding(object target, MvxBindingDescription description) { var factory = FindSpecificFactory(target.GetType(), description.TargetName); if (factory != null) return factory.CreateBinding(target, description); var targetPropertyInfo = target.GetType().GetProperty(description.TargetName); if (targetPropertyInfo != null) { return new MvxPropertyInfoTargetBinding(target, targetPropertyInfo); } var targetEventInfo = target.GetType().GetEvent(description.TargetName); if (targetEventInfo != null) { #warning Handle other event types here - possibly another lookup table so people can register their own? if (targetEventInfo.EventHandlerType == typeof(EventHandler)) return new MvxEventHandlerEventInfoTargetBinding(target, targetEventInfo); } return null; }
public IMvxTargetBinding CreateBinding(object target, MvxBindingDescription description) { var targetPropertyInfo = target.GetType().GetProperty(description.TargetName); if (targetPropertyInfo != null) { try { return _bindingCreator(target, targetPropertyInfo); } catch (ThreadAbortException) { throw; } catch (Exception exception) { MvxBindingTrace.Trace( MvxTraceLevel.Error, "Problem creating target binding for {0} - exception {1}", _targetType.Name, exception.ToString()); } } return null; }
public IMvxTargetBinding CreateBinding(object target, MvxBindingDescription description) { return _innerFactory.CreateBinding(target, description); }