Posts

Showing posts with the label Custom Panel

UniformGrid for Silverlight

Image
Technorati Tags: Silverlight CustomPanel XAML UniformGrid WPF My recent Silverlight project had a need to distribute the items in rows and columns. I had to dynamically calculate the number of columns and rows it needed based on some logic. So it was clear that I need UniformGrid as in WPF so that I can bind my ViewModel properties to Rows and Columns properties of the Panel. But it was a bit surprising to me that there isn’t a Silverlight UniformGrid either in Silverlight SDK or in Silverlight ToolKit. So here is one I ported from WPF. Check out the Silverlight 3.0 demo below. You can also download the sample project

Interactive Silverlight Greeting Card

Image
For the last couple of days I was trying to make an animated e-card using Silverlight. So here is the final result. The speciality of this card is that when we move the mouse over the card we can see it as if it is a 3D object and get the perspective view of the objects(Papervision 3D?). All the Trees and Mountains are Path objects and the particles falling down are random sized ellipses. I have used Microsoft Expression Blend to do most of this work Click here to see the Card in action. The important part of this Silverlight appplication is a Custom Panel called  SpacialArrangePanel . This panel will arrange its children based on two Attached Dependancy Properties. 1) HangingPoint - A point determines its X and Y position in the space 2) ZDistance - A double value determines how far the object is in the Z-plane. There is another DependancyProperty in the Panel called CameraPoint, which has been hooked to the Mouse Move points so that the mouse pointer acts as an Eye/Camera view point ...