private static void SetTargetCore(DependencyPropertyChangedEventArgs e, DependencyObject d, bool setContext) { if (_controller == null) { return; } if (e.NewValue != e.OldValue && e.NewValue != null) { var target = e.NewValue; #if SILVERLIGHT var containerKey = e.NewValue as string; if (containerKey != null) { target = _serviceLocator.GetInstance(null, containerKey); } #endif var handler = new ActionMessageHandler( new ActionHost( target.GetType(), _actionFactory, _serviceLocator ), target ); _controller.AddHandler(d, handler, setContext); } }
private static void SetTargetCore(DependencyPropertyChangedEventArgs e, DependencyObject d, bool setContext) { if(_controller == null) return; if(e.NewValue != e.OldValue && e.NewValue != null) { var target = e.NewValue; #if SILVERLIGHT var containerKey = e.NewValue as string; if(containerKey != null) target = _serviceLocator.GetInstance(null, containerKey); #endif var handler = new ActionMessageHandler( new ActionHost( target.GetType(), _actionFactory, _serviceLocator ), target ); _controller.AddHandler(d, handler, setContext); } }