Solved

C# to vb.net

Posted on 2012-03-23
5
613 Views
Last Modified: 2012-04-02
Could somebody translate this to vb.net..

 Action action1 = () =>  this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardFedListBox"));
                Dispatcher.BeginInvoke(action1);
                Action action = () => CustomPaging((int)PagingMode.Next);
                Dispatcher.BeginInvoke(action);
                _timernextitem.Start();


 Action action1 = () => this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardSecondImageFed"));
            Dispatcher.BeginInvoke(action1);
            Action action = () => BindToSecondImages(lstimgpath);
            Dispatcher.BeginInvoke(action);
            _timerforsecimg.Start();
0
Comment
Question by:jamppi
[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
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37758117
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://www.developerfusion.com/tools/convert/csharp-to-vb/
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758118
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://converter.telerik.com/
0
 

Author Comment

by:jamppi
ID: 37758175
tried that but i get,   'Expression does not produce a Value'
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758385
I *think* but not sure you can do each of them like this:

Public Function() 
Dim action As Action  
BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Return action 
End Function

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 37758521
Use the keyword Sub instead of Function in the above solutions. Action corresponds to a function with a void return. The VB equivalent of a function that returns void is a Sub.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

738 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