コード例 #1
0
        private void ResetEventBinding()
        {
            if (Owner != null)
            {
                if (Behavior.Event != null && Behavior.Owner != null)
                {
                    Behavior.Dispose();
                }

                Behavior.BindEvent(Owner, Event);
            }
        }
コード例 #2
0
ファイル: BehaviorBinding.cs プロジェクト: vbman2012/Phony
 private void ResetEventBinding()
 {
     if (Owner != null) //only do this when the Owner is set
     {
         //check if the Event is set. If yes we need to rebind the Command to the new event and unregister the old one
         if (Behavior.Event != null && Behavior.Owner != null)
         {
             Behavior.Dispose();
         }
         //bind the new event to the command
         Behavior.BindEvent(Owner, Event);
     }
 }