Click here to Skip to main content
15,887,849 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF controls refresh Pin
Pete O'Hanlon31-Jan-13 2:44
mvePete O'Hanlon31-Jan-13 2:44 
GeneralRe: WPF controls refresh Pin
caradri31-Jan-13 10:20
caradri31-Jan-13 10:20 
GeneralRe: WPF controls refresh Pin
Richard Deeming31-Jan-13 11:25
mveRichard Deeming31-Jan-13 11:25 
GeneralRe: WPF controls refresh Pin
caradri2-Feb-13 17:59
caradri2-Feb-13 17:59 
GeneralRe: WPF controls refresh Pin
caradri3-Feb-13 20:16
caradri3-Feb-13 20:16 
QuestionRoutedEvent vs AttachedEvent Pin
devvvy29-Jan-13 22:30
devvvy29-Jan-13 22:30 
AnswerRe: RoutedEvent vs AttachedEvent Pin
Pete O'Hanlon29-Jan-13 22:51
mvePete O'Hanlon29-Jan-13 22:51 
GeneralRe: RoutedEvent vs AttachedEvent Pin
devvvy29-Jan-13 23:02
devvvy29-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:
<br />
   local:GrandChild.GrandChildRoutedEvClick="GrandChild_GrandChildRoutedEvClick"<br />


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


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


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