Skip to main content


Showing posts from November, 2010

Silverlight Tips, Tricks, Tutorials and Links Page

Getting Started TutorialsSilverlight 2 End to End Tutorial: Digg Sample: I recommend reading this post first if you are looking to get started with Silverlight 2 development for the first time.  It not only describes the high-level of what Silverlight 2 provides, but also links to a series of 8 blog posts that walkthrough building a Digg client sample application.  These tutorial posts provide a good introduction to Silverlight 2 and WPF development concepts.  First Look at Using Expression Blend with Silverlight 2: I recommend downloading the Expression Blend 2.5 March preview and following along with this tutorial post.  I think it does a good job of showing off some of the common features of Expression Blend, and uses it to build an IM chat client sample. Jesse Liberty Silverlight Tutorials: Jesse Liberty is writing an in-depth series of articles that cover Silverlight programming concepts in more depth.  Bookmark this page and check back frequently to read them as they get published…

Silverlight Tutorial Sites

Silverlight : How to Declare a Custom User Control from a XAML Page

How to Declare a Custom User Control from a XAML Page.UserControlsare a great way to separate objects into smaller, more manageable chunks of logic. These controls can reused by different applications and are independent from other controls. EachUserControlcan contain any amount of content and logic and can be directly added to your Canvas tree (I.e.MyCanvas.Children.Add(myControl)).
Once you have aUserControlcreated, how do you reference or declare it from another XAML file (such as Page.xaml)? Doing this is relatively straight forward and we will demonstrate how to do this in this tutorial.
Run this application here to preview:
To start, let’s create a customUserControlcalled “Card”. In Visual Studio 2008, Right click on your Silverlight Application and choose “Add->New Item…”.

In the Add New Item dialog, choose “Silverlight User Control” and change the name to “Card.xaml”.

Add the following two images t…

Parsing XML Files

NSXMLParser is a forward only reader or an event driven parser. What it means is, an event is raised whenever the parser comes across a start of an element, value, CDATA and so on. The delegate of NSXMLParser can then implement these events to capture XML data. Some of the events are raised multiple times like the start of an element, value of an element and so on. Since NSXMLParser is known as an event driven parser, we can only read data at the present node and cannot go back. The iPhone only supportsNSXMLParser and not NSXMLDocument, which loads the whole XML tree in memory.

Books Application
To understand how to use an instance of NSXMLParser, let's create a simple navigation based application where we will list the title of the book in the table view and upon selecting a title, display the detail information in a detail view. Click here to see the sample XML file, used in this application.

Create a new application in XCode by selecting Navigation-Based Application, I…

New In iPhone 3.0 Tutorial Series, Part 2: In App Email, MessageUI

This time, we’ll add in-app email to a simple iPhone application using the new-in-3.0 MessageUI framework. Technically neither mail from an app nor MessageUI are new. MessageUI was a private framework prior to 3.0, and apps could send mail using mailto:// URLs, though in a limited way. In any case, with 3.0 and MessageUI, sending messages is straightforward and full featured. We’ll start with working code for a simple app with a UI containing a single button. We’ll add code that shows the compose-an-email message UI and pre-fills the subject and content when the button is pressed. Source/GitHub The code for this tutorial is available on GitHub. To download a copy for yourself, close the repository: Open a terminal and change to the directory where you want the codeClone the repo by typing git clone git://’ve made two separate commits to the repository — an initial commit without in-app email, and a second one with those capabilities added. If you’re follo…