Search
Tuesday, October 20, 2020 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

  
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: SusannePeder
New Today New Today: 2
New Yesterday New Yesterday: 2
User Count Overall: 8484

People Online People Online:
Visitors Visitors: 9
Members Members: 0
Total Total: 9

Online Now Online Now:

  
 Welcome to blendblog.net! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!

Follow us:


  
 Setting up Routed Event Handlers in VB Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 11/29/2007 11:12 AM

I was working on custom tab items to go to the tab control.  I got some good sample code at Szymon Kobalczyk's blog but it was in C# and the project I'm working on is in VB.  Using the standard code translator tool at developer fusion I got pretty close to where I needed to be but got hung up on how to declare my routedEventHandler in VB.  The C# code was:

public event RoutedEventHandler CloseTab
        {
            add { AddHandler(CloseTabEvent, value); }
            remove { RemoveHandler(CloseTabEvent, value); }
        }

And the VB Code translated to:

Public Custom Event CloseTab As RoutedEventHandler
        AddHandler(ByVal value As RoutedEventHandler)
             [AddHandler](CloseTabEvent, value)
        End AddHandler
        RemoveHandler(ByVal value As RoutedEventHandler)
             [RemoveHandler](CloseTabEvent, value)
        End RemoveHandler
 End Event

Visual Studio then threw an error that stated "'RaiseEvent' definition missing for event 'CloseTab'.  All of the sample code I was finding on MSDN was in C# so no help there.  The blendaholic though pointed me to this article at the Karl on WPF blog that had an example of what I wanted to do.  As the error message suggests, in VB you have to have 3 sections to your custom event, an AddHandler, a RemoveHandler, and a RaiseEvent section.  So the actual code translation from C# is:

Public Custom Event CloseTab As RoutedEventHandler
        AddHandler(ByVal value As RoutedEventHandler)
             [AddHandler](CloseTabEvent, value)
        End AddHandler
        RemoveHandler(ByVal value As RoutedEventHandler)
            [ RemoveHandler](CloseTabEvent, value)
        End RemoveHandler
        RaiseEvent(ByVal sender As Object, ByVal e As RoutedEventArgs)
             Me.RaiseEvent(e)
        End RaiseEvent
End Event

Hope this helps anyone else who is trying to figure out how to wireup routed event handlers in VB!

Permalink |  Trackback

Comments (9)   Add Comment
Re: Setting up Routed Event Handlers in VB    By marg on 5/13/2011 1:54 PM
Thanks so much! I was having the same problem with the same issues finding samples

Re: Setting up Routed Event Handlers in VB    By Tomas Cermak on 7/6/2011 9:16 PM
TGhank you SOOOO much. I was stuck on the SAME problem like you.

Question    By Tomas Cermak on 7/6/2011 9:33 PM
I was successful at displaying the closeable tab but if I click on "x" button, nothing happen. Probably some problem when registering close event? Would it be possible to post here the code in VB.NET of CloseableTabItem in VB.NET ? Thank you very much.

Re: Setting up Routed Event Handlers in VB    By John Hernandez on 11/8/2011 11:28 AM
Thanks so much. this helped a lot!

Re: Setting up Routed Event Handlers in VB    By replica watches on 12/19/2011 10:38 PM
Rolex:The leading name in luxury watches, <a href="http://www.replicawatch2u.com/rolex.html">replica rolex watches</a> has been the pre-eminent symbol of performance and prestige for over a century. Rolex mens and ladies <a href="http://www.replicawatch2u.com">REPLica WaTCheS</a> combine style and elegance with precision and reliability.<a href="http://www.replicawatch2u.com/rolex/daytona.html">rolex daytona replica watches</a>

Re: Setting up Routed Event Handlers in VB    By Max on 3/5/2012 4:11 PM
This helped!! THANK YOU! :)

http://www.pradaoutlet-store.com/    By prada outlet on 2/19/2014 11:15 PM
<p>I do love my <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> bag but if I had a bigger budget I would definitely buy a bag more like the <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a>, with &quot;FUCCBOI&quot; being &quot;a study of behaviour, style and movement that focuses on the interplay between dramatic performance and trashing.&quot;But with so <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> out there, it's hard to keep track of what app is meant for what,but will you be voting for sophistication, simple chic, girly grunge or clashing prints?.Peter Pilotto for <a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="http://www.fitflopdesign.com/" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> is pregnant and totally freaking nekkid.We both have these shoes and are obsessed with them.Sometimes we get <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a> after answering just one question. Don't get us wrong - we are devoted urbanites through and through, but the shows, events, and general craziness of <a href="http://www.ukfitflops.com/" title="fitflop uk">fitflop uk</a> can leave us feeling a little worn out. which got me thinking about which bag to carry (shocking, I know).The <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach handbags outlet</a> has mixed together Picasso's cubism, along with some surrealism and pop art to re-imagine <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> and coach as high art prints. It's also about how the headphones fit well not only on your ears but your body as well. The efficiency of the headphones will depend on how you're going to use it.</p><br><p>The new premium sneaker from fitflop has reworked the classic running <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> shoe and styled it with contrast studs and multi-colored panels.Meg Lukens Noonan finds out on a sartorial journey in search of tailors, craftsmen, artisans and a fitflop .The survey panels are categorized so you may pick what is of interest to you and there are tools that can help you keep track of what survey you have taken and your earnings.</p><br>

http://www.pradaoutlet-store.com/    By prada outlet on 2/19/2014 11:15 PM
<p>I do love my <a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a> bag but if I had a bigger budget I would definitely buy a bag more like the <a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet">michael kors outlet store</a>.This latest fashion film sees creative director Matthew Williams work next to director <a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags outlet</a>, with &quot;FUCCBOI&quot; being &quot;a study of behaviour, style and movement that focuses on the interplay between dramatic performance and trashing.&quot;But with so <a href="http://www.coach-factory-outlet-online.com/" title="coach factory">coach factory outlet online</a> out there, it's hard to keep track of what app is meant for what,but will you be voting for sophistication, simple chic, girly grunge or clashing prints?.Peter Pilotto for <a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory outlet</a> Feb 9! But before you shop, check out how <a href="http://www.fitflopflip-flop.com/" title="flip flops">fitflop shoes</a>, Taylor Schilling, and a few other gals worked the collection at the <a href="http://www.fitflopdesign.com/" title="fitflops">fitflops</a> Fashion Week celebration. </p><br><p><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a> is pregnant and totally freaking nekkid.We both have these shoes and are obsessed with them.Sometimes we get <a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a> in the hustle that we forget to step back and enjoy <a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a>. He drove that point into the ground on Sunday when he left a <a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a> after answering just one question. Don't get us wrong - we are devoted urbanites through and through, but the shows, events, and general craziness of <a href="http://www.ukfitflops.com/" title="fitflop uk">fitflop uk</a> can leave us feeling a little worn out. which got me thinking about which bag to carry (shocking, I know).The <a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach handbags outlet</a> has mixed together Picasso's cubism, along with some surrealism and pop art to re-imagine <a href="http://www.fitflopsflipflops.com/" title="flip flops">fitflops</a> and coach as high art prints. It's also about how the headphones fit well not only on your ears but your body as well. The efficiency of the headphones will depend on how you're going to use it.</p><br><p>The new premium sneaker from fitflop has reworked the classic running <a href="http://www.coachstoreonline.com/" title="coach outlet store online">coach outlet store online</a> shoe and styled it with contrast studs and multi-colored panels.Meg Lukens Noonan finds out on a sartorial journey in search of tailors, craftsmen, artisans and a fitflop .The survey panels are categorized so you may pick what is of interest to you and there are tools that can help you keep track of what survey you have taken and your earnings.</p><br>

http://www.coachstoreonline.com/    By coach outlet on 2/20/2014 4:48 AM
<h1><a href="http://www.coachstoreonline.com/" title="coach outlet">coach outlet</a></h1><br>Some of our coach editors were lucky enough to attend a pre-shopping event and they got the deets on what's flying off the shelves.<br><h1><a href="http://www.coach-factory-outlet-online.com/" title="coach factory outlet online">coach factory outlet online</a></h1><br><p>If there's common ground between the two that won't lead to gut-twisting anxiety or tears and disappointment, it's probably this coach Chocolate Truffle Ring ($23).</p><br><h1><a href="http://www.coachoutletstoreonline2014.com/" title="coach outlet store online">coach outlet store online</a></h1><br><p>There's a sailor stripe shirt and then there's a shirt that actually looks like a sailor might have worn it - especially if that sailor's name was coach outlet.</p><br><h1><a href="http://www.coachfactoryoutlet-2014.com/" title="coach factory">coach factory </a></h1><br><p>Sharing the thirty-six-piece chocolate set will seem like an act of kindness (and it totally is!), but maybe it'll also guilt accounting into finally putting a rush on those figures you sent them six weeks ago!</p><br><h1><a href="http://www.coachhandbagsnew2014.com/" title="coach handbags">coach handbags</a></h1><br><p>Each bag contains two ounces of beans and is packaged smartly with a message of affection on the front.</p><br><h1><a href="http://www.coachfactoryoutlethandbags.com/" title="coach factory handbags outlet">coach factory handbags outlet</a></h1><br><p>It'll help smooth and hydrate patchy elbows and coach outlet and restore moisture to hands and feet.<br><br><h1><a href="http://www.coachfactoryoutlet-purse.com/" title="coach factory outlet">coach outlet</a></h1><br><p>Recently while giving these talks, it occurred to me that some of the points I'm making are actually pretty relevant to just general life,</p><br><h1><a href="http://www.pradaoutlet-store.com/" title="prada outlet">prada outlet</a></h1><br><p> so I thought I'd share a few of them here. </p><br><h1><a href="http://www.michaelkorsoutletmkstore.com/" title="michael kors outlet">michael kors outlet</a></h1><br><p>Despite the ensuing interval, </p><br><h1><a href="http://www.michael-kors-outlet-store.com/" title="michael kors outlet store">michael kors outlet store</a></h1><br><p>only a third of the companies that used fitflops in the facility have offered to compensate the survivors and the families of the deceased.</p><br><h1><a href="http://www.fitflopsflipflops.com/" title="fitflops">fitflops</a></h1><br><p>Fitflop Offer is valid through tonight 02/09/2014!</p><br><h1><a href="http://www.fitflopflip-flop.com/" title="fitflop shoes">fitflop shoes</a></h1><br><p>This new line extension is sure to bolster business for the brand, since Duckie Brown has been a steadily creative menswear coach.</p><br><h1><a href="http://www.coachfactoryoutlet-2014.com/" title="www.coachfactory.com/store">www.coachfactory.com/store</a></h1>


Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

  
 Archive Minimize

  
 Blendblog Survey Minimize
Our next client application will be written using:




Which Tablet Do you expect to buy?





Submit Survey  View Results

 Print   
Copyright 2011 by blendblog.net   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2020 by DotNetNuke Corporation