Using sorting functions with Linq for Objects

If you have written Linq queries, you are familiar with OrderBy clause.  Here is a quick example: from one in selected select one).OrderBy(one => one.Name)   If you only need to sort by single field, or even many fields, you are OK.  Here is an example: from one in selected select one).OrderBy(one => one.Name).ThenBy(one=>one.Title) But …

Continue reading ‘Using sorting functions with Linq for Objects’ »

Binding to Silverlight WrapPanel

I had recently investigated the use of WrapPanel for Silverlight.  You can download it along with other controls as part of Silverlight Toolkit.  Example on the web site does not demonstrate the binding to it, so here is how you would do it. You cannot bind to WrapPanel directly because it does not have property …

Continue reading ‘Binding to Silverlight WrapPanel’ »

Showing images from database in in Silverlight

You can show images in Silverlight using Image control.  You can furthermore bind Source property of the image to byte[] type property of a business object.  You would think this is sufficient, but it is not.  You will need a converter to convert byte array into image source. Here is the class for converter public …

Continue reading ‘Showing images from database in in Silverlight’ »

Full screen toggling in Silverlight

If you would like to push browser in and out of full screen mode from Silverlight application, you can do this very easily. To go full screen: Application.Current.Host.Content.IsFullScreen = true To go to normal display: Application.Current.Host.Content.IsFullScreen = false Since Application.Current.Host.Content.IsFullScreen is a property, you can also test for current mode.