Friday, January 7, 2011

Windows Phone 7 and MVVM

Before we get started I would like to mention that as a Silverlight Developer, having the opportunity to make mobile apps without a huge learning curve is great. I can use the same skills that I learn from making Silverlight web application and go mobile. Ok enough of that, let's get going. To follow along make sure you have install the free tools from App Hub.

Saturday, December 18, 2010

Customizing Silverlight's ComboBox Control


Today I will show you how to customize Silverlight’s ComboBox control. To follow along open up Visual Studio 2010 and/or Expression Blend 4 to begin. Create a new Silverlight Application, give it a name and press ok. The goal for this post is to customize the ComboBox to accept input from the user.

Saturday, November 13, 2010

Silverlight 3 and Animation

In this post i will show how simple it is to use animation in silverlight 3 by animating a button width and height. When working with Animation in silverlight, we need an animation object to perform our animation on and a storyboard to handle your animation. Once the storyboard and animation is setup we need a way to trigger the storyboard to start. You have a couple of options for starting a storyboard: using code, using xaml, or (gotostate for silverlight 4) . We will be working in Expression Blend 4 for this example. 

Tuesday, August 31, 2010

WCF Services and Silverlight 4: Basic example using WCF Services

Where is the data classes to get information from databases? I can't find them. We'll you can stop looking because they don't exist in silverlight. The answer to getting data into your silverlight application is web services. In this post I will show the basic steps to get data into your silverlight application using WCF services.

To begin open up Visual Studio 2008 or Visual Studio 2010. Select File ->New->Project. Select the silverlight application template, give it a name and click OK. After clicking OK, visual studio present a dialog box allowing you to choose which silverlight version you want to target, an option to enable wcf ria services, and the web project type. For the purposes of this post, accept the default and click OK.

Monday, August 30, 2010

Using the GridView,DetailsView with Asp.net 3.5 and LinqToSql

In this post I will demonstrate how to use the Asp.net GridView and DetailsView control with LinqToSql. Let's begin by creating an Asp.net web project in Visual Studio 2010. Now that our project template is created, add a new webform to the project, call it DetailsPage or name it whatever you want.

Open up the Default.aspx page and drag a GridView control onto the design view. The Default.aspx page is where we will search the database for data. Once we get data back, the user will be able to select a record from the GridView which will redirect them to the DetailsPage.aspx where they can edit the record and submit their changes.

Saturday, May 15, 2010

Silverlight 4 Navigation and MEF

Problem : "Element is already the child of another element."


Building modular apps with Silverlight 4 and MEF was pretty easy for my first attempt, using the Silverlight Application template. But when I tried to take the same approach and apply it to a silverlight navigation template I get this error: "Element is already the child of another element.". This error is caused by navigating to another page and then back to the previous page. 


(Ex: say you on home.xaml and navigate to about.xaml and then back to home.xaml, the error mention above will be thrown.)

How to resolved error

To reproduce, simply override the OnNavigatedFrom event  and do any clean up is necessary.

Ex:
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
              //clear items that you may have imported from MEF
              //TopLeftRegion.Items.Clear();
        }

Enjoy!

Tuesday, April 27, 2010

New features in Silverlight 4

Silverlight 4 has many new features that makes silverlight development a lot easier. Listed below are features that have been added in silverlight 4.
  • Tooling
  • Printing API
  • Right Click Handling
  • Webcam and Microphone support
  • RichTextArea Control
  • ICommand Support
  • Clipboard API
  • Com Interop
  • MEF
  • Google Chrome support
  • Text Trimming
  • Implicit theming
  • Notification/toast API
  • Evaluated trust Apps
  • Local file access
  • Mouse Wheel Support