Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Animating databinding changes ?

Closed Thread
 
Thread Tools Display Modes
Old 06-11-2006   #1 (permalink)
jods
Guest


 

Animating databinding changes ?

I was toying with WPF and doing some gratuitous effects, when I wondered if
the following idea was possible.

I display a card (e.g. think about an ID card) in a master/detail format. So
when the user selects another person in the master list, the details on the
ID card are automatically updated.

So far so good, but what would be nice is to animate the change. I would
like to flip the card, and when you see the back of the card it's the new
data.

Flipping the card in itself is easy, one can just use a transform. But what
I can't figure out how to do, is to freeze the data. When you databind, any
change apply immediately. In this scenario, I need to delay them:
1- keep the old data displayed and flip the card until the edge is in front
of the user.
2 - now the user can't see the data anymore, so apply the new data.
3 - continue flipping the card, bringing the new data in view.

I guess animating the transitions will become a common eye-candy with WPF.
So I'm sure there should be a way, but I don't find it.

Thanks,
jods
Old 06-12-2006   #2 (permalink)
Sven Devriese
Guest


 

Re: Animating databinding changes ?

"jods" <jods@discussions.microsoft.com> wrote in message
news17E44F6-1F11-4DBB-9CF2-88FD7A552817@microsoft.com...
>I was toying with WPF and doing some gratuitous effects, when I wondered if
> the following idea was possible.
>
> I display a card (e.g. think about an ID card) in a master/detail format.
> So
> when the user selects another person in the master list, the details on
> the
> ID card are automatically updated.


Have you tried the (IMHO) obvious ? I would split your animation in two.
The first flips the card so that its back is shown.
Then you change the databinding so that the UI is updated, but the
user doesn't see it because they're looking at the back side.
The second animation flips the card back so that the front side is shown
again.

This is coming from a Avalon-would-be-developer (i.e. haven't yet gotten
around to actually getting my fingers dirty with it but I have watched all
the
sexy C9 interviews and demo's and I lurk in this newsgroup) so I may be
just full of it. :-)


Old 06-12-2006   #3 (permalink)
jods
Guest


 

Re: Animating databinding changes ?

Thanks for the suggestion.

Of course this is something that I have considered. But it really feels like
one step backwards. I love the simplicity and power of databinding in WPF.
Somehow, launching an animation, intercepting one event mid-animation, then
launching another animation feels a lot more awkward than it should. And
there's one problem, which I don't know how to handle:

What if there are several pieces of UI which I want to animate ? Let's
imagine that I display 2 cards instead of one (e.g. ID and driver license).
Now, one is maybe smaller than the other - or whatever - and maybe the moment
where one should refresh the binding may not be the same. But if I change the
current item in my CollectionView, all items will get refresh at the same
time.

I guess the best way would be to have some kind of "SuspendedBinding"
property, which I could add in my Storyboard.
Or maybe this was just a silly idea... it was pretty gratuitous anyway, just
out of curiosity.

Anyway, I would be interested if someone from the WPF team answers, this
looks like the kind of useless candy that WPF was made to enable... ;-)
Old 06-20-2006   #4 (permalink)
Marek
Guest


 

Re: Animating databinding changes ?

Maybe you can use Binding.Converter which is called before data is put
from/to source to/from target - there do the one half of the animation. Then
in Binding.TargetUpdated event do the other one half of the animation...

Old 06-20-2006   #5 (permalink)
jods
Guest


 

Re: Animating databinding changes ?

Hey, that sounds like an idea. Not too sure how it will work, but I will give
it a try.

Thanks!
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animating Width/Height to an auto value Ramon de Klein Avalon 0 05-27-2008 04:06 AM
Animating bounding INotifyCollectionChanged events in WPF fil Avalon 0 02-20-2008 08:40 PM
Aero icons stop animating 2disbetter Vista performance & maintenance 1 11-27-2007 03:14 PM
Target name cannot be found when animating storyboard programmatically stanley_r_eisenberg@raytheon.com Avalon 7 05-16-2006 09:07 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50