Matthew Pitts
Matthew Pitts

Reputation: 859

Can someone help me convert this to VB

I tried an online converter, but it sucks. Any help is appreciated.

// Set the event handler for when the application data object changes.
(Application.Current as ExecutionModelApplication.App).ApplicationDataObjectChanged +=
                    new EventHandler(MainPage_ApplicationDataObjectChanged);

Upvotes: 1

Views: 145

Answers (3)

Schu
Schu

Reputation: 1164

AddHandler TryCast(Application.Current,ExecutionModelApplication.App).ApplicationDataObjectChanged,_
AddressOf MainPage_ApplicationDataObjectChanged

Upvotes: 0

Simon Mourier
Simon Mourier

Reputation: 138960

Maybe

   AddHandler TryCast(Application.Current, ExecutionModelApplication.App).ApplicationDataObjectChanged, New EventHandler(AddressOf MainPage_ApplicationDataObjectChanged)

Upvotes: 0

KV Prajapati
KV Prajapati

Reputation: 94645

Try this,

AddHandler CType(Application.Current,ExecutionModelApplication.App).ApplicationDataObjectChanged, 
    AddressOf NameOfHandlerMethod

Event Handler:

Proctected Sub NameOfHandlerMethod(sender as Object, E as EventArgs)
  .
End Sub

Upvotes: 2

Related Questions