Recommended

  • Silverlight 4 Podcast Pack with Tim Heuer
  • Building Modular Silverlight Applications
  • Prism -  10 Things to Know
  • Securing Silverlight Application and WCF Service using ASP.Net Authentication Techniques
  • Model– View – ViewModel in Silverlight
Skip Navigation LinksHome / Articles / View Article

I've been on an 'animate everything' kick lately, ...

+ Add to SilverlightShow Favorites
0 comments   /   aggregated from house of mirrors on Aug 21, 2006  /  original article
(0 votes)
Categories: Misc
I've been on an 'animate everything' kick lately, my first target was dialogs. With the new transparent windows in the July CTP, WPF makes it extremely easy to animate the opening and closing of the dialog windows.

I modeled my dialog effect on the popular web technique 'lightbox' (aka greybox), a simple example of which is Lightbox JS, but it should be quite simple to custom tailor your own dialog.

The cool thing here is that the dialog is a real modal dialog, not just another element at the top of the visual tree.


You'll have to excuse my really lame sample project though- I haven't yet written the rest of the app this was intended for. I'm hoping everyone has a good imagination instead.

The box in the middle is a fully modal dialog- I styled it to remove the titlebar and added some fade in/fade out behavior. The main window is just animated to 50% opacity when the dialog comes up. The alternative could have been to overlay 50% transparent rectangle but this way I was able to make the dialog class quite portable. Since the dialog is modal, the OS prevents click-throughs to the main window.

The only tricky part was delaying the actual dialog close to allow time for the outro animations to complete, but that really was quite trivial.

Source
Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 3 and 4 and type the answer here: