Navigation


Markus on Development and Publishing

This is Markus Egger's professional blog, which covers topics such as development, publishing, and business in general. As the publisher of CoDe and CoDe Focus magazines, and as the President and Chief Software Architect of EPS Software Corp., Markus shares his insights and opinions on this blog.

Content Area Footer

Thursday, January 12, 2006
Triggering Animations Programmatically in WPF/Avalon/XAML

In the past, it was possible to trigger animations in Avalon (WPF/XAML) programmatically by first finding an animation's timeline, then finding the associated storyboard clock, and then using that clock's controller to trigger the animation. Here is a typical example:

Timeline tl = this.FindName("myTimeline") as Timeline;
Clock clock = this.FindStoryboardClock(tl);
clock.ClockController.Begin();

This was a bit tricky and confusing. In the December 05 CTP build, this has changed. An animation can now be triggered relatively easily, simply by triggering a storyboard:

Storyboard s = this.FindResource("myStoryboard") as Storyboard;
s.Begin(this);

That's it! Much easier, and more intuitive. However, if you are used to the old way, you may end up searching for hours to figure out how easy it now is... ;-)

Note: This assumes that the animation is put into the resources section of the main scene/window/page. If the storyboard is located elsewhere, you'd have to reference it at that particular location.



Posted @ 7:37 PM by Egger, Markus (markus@code-magazine.com) -
Comments (4)


 

 

 

 

 

 

 

Syndication RSS 2.0 RSS 2.0

All My Blogs:
My personal blogs:
Dev and Publishing Dev and Publishing
Travel and Internat. Living Travel and Internat. Living
Other blogs I contribute to:
Milos Blog (US) Milos Blog (US)
VFPConv. Dev Blog (US) VFPConv. Dev Blog (US)
VFPConv. Dev Blog (DE) VFPConv. Dev Blog (DE)

 

Blog Archives
All Blog Posts

2015
    September (1)
2012
    September (1)
    April (1)
    March (1)
2011
    October (1)
    June (3)
    May (1)
    March (2)
    February (2)
    January (2)
2010
    December (3)
    November (2)
    October (2)
    September (1)
    August (2)
    July (1)
    June (1)
    April (3)
    March (1)
    February (5)
    January (1)
2009
    October (4)
    September (2)
    August (1)
    July (1)
    May (4)
    April (6)
    February (1)
    January (1)
2008
    December (3)
    November (11)
    October (8)
    September (1)
    July (1)
    June (3)
    May (3)
    April (6)
    March (6)
    February (4)
2007
    December (1)
    November (1)
    October (5)
    September (1)
    August (1)
    July (6)
    June (3)
    May (3)
    April (1)
    March (2)
    January (2)
2006
    December (3)
    November (4)
    October (1)
    September (2)
    August (2)
    July (4)
    June (1)
    May (2)
    April (10)
    March (2)
    February (3)
    January (1)
2005
    December (6)
    November (7)
    October (6)
    September (8)
    August (10)
    July (6)
    June (9)

 

 

 

This Blog is powered by MilosTM Collaboration Components.