What is so special about ObservableCollection?

by rahul 7/31/2011 10:37:00 PM
Simple answer is… it is just like a regular collection except that it implements a couple of pretty interesting interfaces, INotifyCollectionChanged and INotifyPropertyChanged. Let's dive in. Take a look below.   What is so special about the ObservableCollection then? When would you use it? The reason why you would use it, is the magic word called DataBinding, which is a lifesaver, especially when you are using Silverlight/WPF applications. To bind to any variable/class is easy. Th... [More]


Dependency Property explained

by rahul 5/6/2011 10:12:08 PM
The concept of dependency property is fascinating. I have seen a lot of confusion around it, and here is my take on it. Without further ado, let me take you to XAML, and its output. XAML <UserControl x:Class="Dependency_Sample.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="h... [More]


Create Trial applications for Windows Phone 7 MarketPlace

by rahul 4/12/2011 4:03:45 PM
There are a few ways in which you can easily create Trial applications for Windows Phone 7 marketplace. Here is what I prefer to do it fairly quickly.     Create a new Project or use an existing project. Select Configuration Manager     From the Active Solution Configuration drop down list, select New…     Name it Release_Trial, and copy the settings from Release.     Now, you will three options… Debug, Release a... [More]


A couple of applications for Windows Phone 7

by rahul 3/17/2011 6:15:18 AM
Finally I was able to get Windows Marketplace account. Although the initial experience with the marketplace was a bit "hiccupy", I liked the creation piece of small utilities for my kid, Anika… whom I fondly call nikkul. I have hosted those utilities on Windows Phone 7 Marketplace, and you can find more details on www.nikkul.com… If you are a parent with young kids, you should check these out. Memory match is a game, where as the second one is a tool with which you can teach time ... [More]


Bind your Silverlight elements to local variables

by rahul 3/1/2011 11:25:32 PM
So you have a XAML page, and in the code behind you have a couple of variables. How do you bind the elements with the local variables?     To begin with, you will need the property with which you can bind the XAML element.     Implement the following interface… INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String info) { if (PropertyChanged != n... [More]


Play multiple sound files in Silverlight for Windows Phone 7

by rahul 2/14/2011 11:10:20 PM
Windows Phone 7 doesn't support multiple MediaElement. In order to play multiple sounds in the same page, you may use the following approach.     Add a reference to Microsoft.Xna.Framework     Add the following using statements… using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio;     Add the sound files and ensure that Copy to Output directory is set to Content     Add the follow... [More]


Silverlight - How to load and clip an image in code

by rahul 1/31/2011 1:21:08 PM
Let's say you have an image like the following… Fig 1 And you want to clip it using a hexagon [see Fig 2]. Or may be a rectangle with rounded edges. Clipping an image using a Geometry makes it really easy for you. You can use Expression Blend and easily do the clipping. The problem arises if you have to do the same thing in code. Fig 2 In this post, you will see how easily it can be done in code. The code is annotated with comments, and I hope you will find it useful. using System; us... [More]


Future of Silverlight

by rahul 11/14/2010 9:31:31 AM
You’re invited to a very special event on December 2nd, 2010 Learn about the future of Silverlight from Corporate Vice President, Scott Guthrie and other experts, direct from Microsoft’s HQ. Hear about our plans for the next version of Silverlight, the latest developments as well as in-depth sessions on building applications with Silverlight. Registration is free – take part in-person or online. ... [More]


Did You Know : The difference in a Rectangle with or without a Fill in Silverlight/WPF?

by rahul 10/25/2010 9:34:20 AM
Check out the following XAML and notice the difference in Fill of the following three rectangles. <StackPanel> <Rectangle Stroke="Black" StrokeThickness="3" Width="100" Height="100" Margin="5" MouseLeftButtonUp="rect_MouseLeftButtonUp" Fill="Transparent" /> <Rectangle Stroke="Black" StrokeThickness="3" Width="100" Height="1... [More]


Silverlight - Application Structure - 2 - Load assembly on demand

by rahul 10/12/2010 5:55:46 PM
In the previous post, we discussed about how to use Application Library Caching and its benefits. Although it sounds beneficial, you need to keep in mind that the benefits are more from a re-visit perspective. Sometimes, your application will have a bunch of pages, may be nested… and hence you may not require some part of functionality right away. In that case, it might not be considered wise to create the structure in such a way that each and everything is loaded right from the word, Go! This ... [More]


Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0