Click here to Skip to main content
12,406,528 members (31,678 online)

Silverlight / WPF

 
AnswerRe: WPF controls refresh Pin
Pete O'Hanlon31-Jan-13 2:44
protectorPete O'Hanlon31-Jan-13 2:44 
GeneralRe: WPF controls refresh Pin
caradri31-Jan-13 10:20
membercaradri31-Jan-13 10:20 
GeneralRe: WPF controls refresh Pin
Richard Deeming31-Jan-13 11:25
memberRichard Deeming31-Jan-13 11:25 
GeneralRe: WPF controls refresh Pin
caradri2-Feb-13 17:59
membercaradri2-Feb-13 17:59 
GeneralRe: WPF controls refresh Pin
caradri3-Feb-13 20:16
membercaradri3-Feb-13 20:16 
QuestionRoutedEvent vs AttachedEvent Pin
devvvy29-Jan-13 22:30
memberdevvvy29-Jan-13 22:30 
AnswerRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon29-Jan-13 22:51
protectorPete O'Hanlon29-Jan-13 22:51 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy29-Jan-13 23:02
memberdevvvy29-Jan-13 23:02 
Pete O'Hanlon wrote:


So, what is an attached event? Well, basically, it's an event that can be attached to another element without the other element having to be aware that this capability is present. If you think about it as being like an attached property for events then it starts to make sense. So, why do we have this? Well, it allows you to extend WPF through composition rather than inheritance.


I understand perfect "Grid.Row" is an "Attached Property" that it's not a property of "TextBox" itself for instance. I understand analogy when this concept extended to "Events". However - what's confusing is the SYNTAX: you can define an event handler to a RoutedEvent the same way/syntax as you would with AttachedEvent.

But if you see the sample I gave in MainWindow.xaml, I can subscribe to "AttachedEvent" and "RoutedEvent" from xaml in same syntax - the syntax which does not require "Instance" of "GrandChild" (i.e. "MainWindow" does NOT implement event GrandChildRoutedEvClick itself, which is declared in "GrandChild")

From MainWindow.xaml, "RoutedEvent" handler setup like this:
local:GrandChild.GrandChildRoutedEvClick="GrandChild_GrandChildRoutedEvClick"


From MainWindow.xaml, "AttachedEvent" handler setup like this:
local:GrandChild.GrandChildAttachedEvClick="GrandChildAttachedEvClickHandler"

Despite in "MiddleChild.xaml", I setup handler to "RoutedEvent" the "Propery way"... what's real diff between Routed/AttachedEvent besides phylosophical or syntactical ...?
[local:GrandChild x:Name="Junior" VerticalAlignment="Stretch" GrandChildRoutedEvClick="GrandChild_GrandChildRoutedEvClick"/]

What I am saying is, you can define a DockStateChanged event with syntax of a "RoutedEvent" - not "AttachedEvent", and in some parent control couple layers up, setup event handler using syntax as you would consuming an "AttachedEvent"

dev


modified 30-Jan-13 5:11am.

GeneralRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon30-Jan-13 0:45
protectorPete O'Hanlon30-Jan-13 0:45 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 2:40
memberdevvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon30-Jan-13 2:44
protectorPete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy30-Jan-13 3:08
memberdevvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button Pin
Kevin Marois29-Jan-13 18:03
memberKevin Marois29-Jan-13 18:03 
AnswerRe: WPF Tab Item Close Button Pin
SledgeHammer0129-Jan-13 19:02
memberSledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button Pin
Kevin Marois2-Feb-13 15:33
memberKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button Pin
SledgeHammer012-Feb-13 18:25
memberSledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pin
jeffdavis870329-Jan-13 9:12
memberjeffdavis870329-Jan-13 9:12 
AnswerRe: Custom Control Template for beginners Pin
SledgeHammer0129-Jan-13 11:32
memberSledgeHammer0129-Jan-13 11:32 
GeneralRe: Custom Control Template for beginners Pin
jeffdavis870329-Jan-13 12:10
memberjeffdavis870329-Jan-13 12:10 
GeneralRe: Custom Control Template for beginners Pin
SledgeHammer0129-Jan-13 12:46
memberSledgeHammer0129-Jan-13 12:46 
GeneralTreeview Selection Pin
vijilvs11628-Jan-13 23:03
membervijilvs11628-Jan-13 23:03 
QuestionProblem With TreeViewItem Tooltip Pin
Kevin Marois26-Jan-13 15:39
memberKevin Marois26-Jan-13 15:39 
GeneralRe: Problem With TreeViewItem Tooltip Pin
Thomas Duwe29-Jan-13 1:46
memberThomas Duwe29-Jan-13 1:46 
QuestionHow to get a value from treeview. Pin
boryborawski26-Jan-13 12:06
memberboryborawski26-Jan-13 12:06 
QuestionConstant header and footer Pin
columbos1492725-Jan-13 23:11
membercolumbos1492725-Jan-13 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160730.1 | Last Updated 29 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid