Event attributes or Handles clauses for VB users of XAML
Another internal question that likely will be helpful to some non-Microsoft employees:
From: Rob Relyea
Sent: Tuesday, August 08, 2006 11:52 AM
Subject: RE: EventHandlers in .xaml.vb
We support handles.
When we are targeting VB, we do the necessary things with codedom to make sure that the fields are defined “with events”.
Note, you don’t want an Event Attribute and a handles – this will fire the event twice.
I believe most VB users will prefer Handles over the attribute.
From: Some MS Employee
To: Rob Relyea
Subject: EventHandlers in .xaml.vb
It sounds like it’s possible to hook up event handlers in VB through a Handles clause on the method.
Sub OnClick() Handles okButton.Click
Is this supported by the Avalon compiler or is an explicit Click=’OnClick’ required in XAML? What is the recommended approach for VB?