Fixed #89: Ensured EventTriggerBehavior supports x:Bind bindings

For x:Bind to work with EventTriggerbehavior, we need to ensure that no
exception gets raised for not finding the request event on the source
object, as this will might (will) get evaluate at a later phase.

So instead of raising an exception, we just gracefully return from the
method.
This commit is contained in:
Pedro Lamas 2016-02-25 15:12:40 +00:00
Родитель 3c2d2b1aeb
Коммит 3c04fc7f6a
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -175,11 +175,7 @@ namespace Microsoft.Xaml.Interactions.Core
EventInfo info = sourceObjectType.GetRuntimeEvent(eventName);
if (info == null)
{
throw new ArgumentException(string.Format(
CultureInfo.CurrentCulture,
ResourceHelper.CannotFindEventNameExceptionMessage,
this.EventName,
sourceObjectType.Name));
return;
}
MethodInfo methodInfo = typeof(EventTriggerBehavior).GetTypeInfo().GetDeclaredMethod("OnEvent");