Skip to content

Event attributes or Handles clauses for VB users of XAML

August 8, 2006

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
Rob –
It sounds like it’s possible to hook up event handlers in VB through a Handles clause on the method.

<Button Name=’okButton’/>

Sub OnClick() Handles okButton.Click
   

End Sub

Is this supported by the Avalon compiler or is an explicit Click=’OnClick’ required in XAML? What is the recommended approach for VB?

From → XAML (non-UI)

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: