Friday, February 12, 2010

Styles and storyboards in code


Today I have been playing wit some WPF to emulate the idea of the Mac dock in a scrollview that shows pictures.
I thought I would use a mixture of XAML and code to create storyboards that expand an image when the mouse is over it and reduces it again once it leaves.
For this I created a single style, programmatcally filling the EntryAction and ExitActiion for the trigger.
This all worked fine until I tried to cope with a resize. First I noticed that my effects ran slower as I resized. Obviously I had added and compounded the storyboards such that there were many being triggered at once. Upon trying to remove them I found that animations get "Sealed" and can no longer be changed. As this is interesting I think i'll do a wee article on it.
I had a discussion with a friend the other day who said that WPF still seems to be difficult for use in desktop line of business apps. My current investigation is in some way related to that idea because I think that with judicious use of code and XAML much more is possible.



No comments: