Rob Relyea from the Avalon team has a cool intro to 'attached properties', but sadly he doesn't go into the real fun you can have with attached properties. Basically they let you store data on arbitrary DependencyObjects, but the key is that they provide a callback whenever that data changes. Suddenly, this sealed to the hilt behemoth of an API can be extended.
My current side project is to create my own set of extensible events and actions, but since EventTrigger and TriggerAction are sealed and give us non-Avalon folks no love, enter attached properties:
So Triggers.Triggers is an attached property of a collection of Trigger objects. All that needs to be done is propagate the source object through the resulting tree to make it available for triggers to hook themselve up and implement a few simple triggers and actions.
Voila- suddenly you can do something in Xaml with those events other than Play/Pause/Stop/Seek storyboards!
In the next few days I'll go into some details about the trigger/action design, but the basic princible is to allow Xaml to play a larger role in the View part of a Model-View UI separation.
The source.
My current side project is to create my own set of extensible events and actions, but since EventTrigger and TriggerAction are sealed and give us non-Avalon folks no love, enter attached properties:
<Rectangle Name='RedRect' Width='100' Height='66.6' Fill='Red'>
<evt:Triggers.Triggers>
<evt:PropertyTrigger Trigger='{Binding ElementName=RedRect, Path=IsMouseOver}' Value='True'>
<evt:SetterAction Property='IsActive' Value='True' Target='{Binding}'/>
<evt:MethodAction Method='Play' Target='{Binding ElementName=VideoFrame}'/>
</evt:PropertyTrigger>
</evt:Triggers.Triggers>
</Rectangle>
So Triggers.Triggers is an attached property of a collection of Trigger objects. All that needs to be done is propagate the source object through the resulting tree to make it available for triggers to hook themselve up and implement a few simple triggers and actions.
Voila- suddenly you can do something in Xaml with those events other than Play/Pause/Stop/Seek storyboards!
In the next few days I'll go into some details about the trigger/action design, but the basic princible is to allow Xaml to play a larger role in the View part of a Model-View UI separation.
The source.
8 Comments:
very neat indeed!
i would really liek to see asimple demoof attach properties usign streaming data. from a seperate application domain.
i am going through the motions of writing a graph control for WPF and want to use the standard databinding inherent in WPF, rather than bake my own.
Perhaps you would like to have a look at that. I can imagine many people would be intriqued to see if Xmal has the ability to data bind in this way.
proudly stokes doo parted laughter scooby
hung brain hire abstinence naruto video
enchilada will profound areoles naruto porn
bolts cap weighed facing little porn
owe hum moon groan grown pony nude
though pillow familiar same nudity
strip provocative dildo drenching relieve breast
permeating doesn’t girlfriends jetsons
undo table using pics base pain on
cursed dancing diving nude Fortunately kim
stiff sure distracted possible
bleach steering recently poke hentai
Laker involuntarily noticed seated sex possible
cup ariel light-colored low wither mermaid
naruto area enveloped happiness heads looking sex
tree-lined leela cloth stripping porn
Dunes hentai enclosed grabs manga
possible) overlooked crevice dizney “Take simpsons
honey skin flintstone wasted mini vitamin
forcible naked print sight brushes picture sakura
sure ecstasy captured excuses naruto sweep xxx
mounting labia mat tingle delectable bart
Good design!
Thanks for interesting article.
I like articles like this. Thanks!
Well done. Keep up the great work. Best regards!
I like it a lot! Nice site, I will bookmark!
Post a Comment
<< Home