Animating ViewModel Properties instead of View Bound Properties

Monday, January 24, 2011

Trying to animate a View property which is bound two-way to a View Model property, yields working animation but also unchanged View Model. It turns out that animating a two-way data-bound property breaks the data-binding! For example, having a line bounds to its view-model, X1, Y1, X2, Y2 properties, if you'll try to animate the Line, the line will be animated but at the same time its X1, Y1, X2, Y2 properties will left unbound. So how to fix that? Instead of animating the view, animate the view-model. Anyhow, it's much easier to reflect view-model...
no comments

Blend Behaviors via Attached Properties – Part 1

Saturday, November 7, 2009

Up until Blend 3, UI designers had difficult time prototyping a real functional UI. The main problem was the lack of behaviors. Creating a UI prototype that deals with navigation, window creation on event, animation on data changes etc, usually ends up with source code development. And when it comes to coding, UI designers had to have kind of developer colleague. XAML Tools Over time, developers (like me :) created many XAML extensions using both XAML Markup Extensions and the powerful Attached Property mechanism. See this post for example. The main problems with such an approach are...
no comments

<howto> Start Animation on Model property changed </howto>

Friday, November 6, 2009

Lately I’m teaching UI designers to work with WPF, and one of my students asked me how to start an animation when model’s property changes, and this was my answer: If the animated element is part of a DataTemplate, use DataTrigger to monitor data changes and to start the animation. But if you don’t have a DataTemplate or the animated element is not part of the DataTemplate, create a Style for that element, and use a simple DataTrigger within. <Style x:Key="PathStyle" TargetType="{x:Type Path}"> <Style.Resources> ...
no comments

Copy file animation – Just in Case

Friday, August 28, 2009

Last few days I’ve upgraded the XP2Win7 Trigger Start Service demo application UI to WPF. Unfortunately I had no time to add the copy images from USB animation. So just in case that you write kind of copy file application here is a WPF animation I made: Note that this animation demonstrates how to render a 2D element as 3D by using the WPF Viewport2DVisual3D with animation. You can download the code from here.
no comments