Search
Thursday, November 20, 2008 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

 Print   
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: areel
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 15

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

Online Now Online Now:

 Print   
 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!


 Print   
 Executive Summary on Routed Events Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 2/1/2008 12:05 PM

A week or so ago when was learning about dependency properties I read a ton of theoretical stuff out there which is very important, but at the end of the day didn't understand the actual, tangible difference between them and regular properties.  The "how does this actually apply" in the real world was missing so I spent a day playing around with them and posted my findings as sort of an executive summary.

Today I was working on events in a user control and for the first time had to use a routed event.  Again, I had read a ton about routed events but didn't understand the exact implications in the IDE and "real world" of what they meant.  Its simple actually.  Regular events still work, but if you want to do anything in Blend or at the "XAML" level with your events you are going to need routed events.  In my code I declared an event in my user control the regular way, compiled, and as always could receive that event on my form that hosts the usercontrol in code.  However, in Blend I could not add a trigger on my usercontrol for that event.  I then changed my regular event to a routed event and voila, I could also consume it in Blend as a trigger.  The event I wanted the form to act on was when a maximize button was pressed on the user control.  The form is then going to re-do its layout using an animation.  The event is now simply built in the usercontrol as:

    Public Shared ReadOnly btnMax_Clicked_Event As RoutedEvent = EventManager.RegisterRoutedEvent("btnMax_Clicked", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(ENPSvXObjectHost))
    Public Event btnMax_Clicked As RoutedEventHandler

That's all there is to it.  If you want to use your events in Blend (XAML) you have to make them Routed Events!

Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

 Print   
 Archive Minimize

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




Submit Survey  View Results

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