Skip to content

Commit

Permalink
Fixed #89: Ensured EventTriggerBehavior supports x:Bind bindings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pedrolamas committed Feb 25, 2016
1 parent 3c2d2b1 commit 3c04fc7
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ private void RegisterEvent(string eventName)
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");
Expand Down

0 comments on commit 3c04fc7

Please sign in to comment.