Solved

Convert to VB.net

Posted on 2014-03-18
3
299 Views
Last Modified: 2014-03-18
I'm trying to convert some C# code to VB.net, but the control in question is from the WP Toolkit and has no intellisense to help me work out what is happening.  I'm guessing that it's an event handler but I don't know where s1 comes from.  Can someone VBize it please?

messageBox.Dismissed += (s1, e1) =>
    {
        switch (e1.Result)

Open in new window

0
Comment
Question by:Dodsworth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39936975
Please provide the delegate definition for the Dismissed property.
0
 
LVL 1

Author Comment

by:Dodsworth
ID: 39937324
There doesn't appear to be one.  But I found this in the object browser..

Public Event Dismissed(sender As Object, e As Microsoft.Phone.Controls.DismissedEventArgs)
Member of Microsoft.Phone.Controls.CustomMessageBox
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39937436
That's what I was after  = )

I don't work in VB often enough to remember all of the intricacies of implicit delegates, but hopefully this is an accurate translation. You may be able to nix the "ByVal ... As XXX" parts and just leave the variable names.

AddHandler messageBox.Dismissed, Function (ByVal sender As Object, ByVal e As EventArgs)
                                     Select Case e1.Result
                                         Case ...
                                     End Select
                                 End Function

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question