Jeremy Bytes

byte-sized chunks of .NET

Skip Navigation Links
 

Demos

Introduction to Data Templates And Value Converters in Silverlight

Business applications are all about data, and laying out that data is critical to creating a good user experience. Silverlight has several tools, including Data Templates and Value Converters, that make this easier for the business developer to manage. By the time we're done, you will have a good understanding of the basics of both of these valuable tools.

Introduction to XAML: Don't Fear the Markup

Understanding XAML (eXtensible Application Markup Language) is a key to creating the latest .NET user experiences in WPF, Silverlight and Windows Phone. We will introduce the basic concepts around XAML and take a look at various features such as namespaces, elements, properties, events, attached properties and some basic layout. We’ll create a simple WPF / Silverlight application that covers these fundamentals. Although you will probably end up doing most of your UI design with a drag-and-drop tool such as Expression Blend, knowing the internals gives you a leg up in making the final tweaks to ensure an excellent user experience.

NOTE: This demo is available in both WPF and Silverlight versions. The same XAML features are covered in each environment.

Get Func<>-y: Delegates in .NET

Do you use delegates in .NET? If so, then Func<T> and Action<T> are just waiting to make your life easier. Not using delegates? Maybe you should. We'll take a look at what delegates are, why you would want to use them, and how to use Func<T> and Action<T> to tie things all together (with a few Lambdas thrown in just for fun).

Keep Your UI Responsive with the BackgroundWorker Component

Long running processes are a user experience killer. How many times have you had an application "lock up" while trying to do some function? The BackgroundWorker component in .NET allows you to spawn those long running processes in the background and keep your WPF, Silverlight or WinForms user interfaces responsive. We'll take a look at the features of the BackgroundWorker in a WPF application including running a background process, updating the progress in the UI, and cancelling the process before it has completed.

Learn the Lingo: Design Patterns

You already use Design Patterns but probably don't know it. Observer, Adapter, Iterator, Proxy -- Learning the lingo allows you to better communicate your ideas with other developers. We'll take a look at several GoF patterns that we regularly use without realizing it. Don't know who the GoF is? Read on to find out.

Learn to Love Lambdas

Lambda expressions can be confusing the first time you walk up to them. But once you get to know them, you’ll see that they are a great addition to your toolbox. Used properly, they can add elegance and simplicity to your code. And some .NET constructs (such as LINQ) lend themselves to lambda expressions. We’ll take a look at how lambda expressions work and see them in action.

Meet the Next Code Camp Speaker: You!

Ever wonder where the speakers for Code Camp come from? Just look in the mirror. Everyone has something to share. Take the next step and sign up as a speaker. In this informal session, we'll talk about some practical tips to make your session successful.

IEnumerable, ISaveable, IDontGetIt: Interfaces in .NET

Best practices tell us to program to an interface rather than a concrete class. Let's start by understanding what a .NET Interface is and what it means to our code. After that, we'll look at a couple of practical implementations that can make our code more robust and extensible.

Quick Byte: Get Func<>-y (Jan 2011)

If you look into the LINQ extension methods, you will run across Func<T, TResult> quite a bit. If you see a Func<> in a method definition, you can treat it like a big sign that says "Put your lambda expression here." What we'll see is that Func<> is simply shorthand for creating a delegate.

Quick Byte: Extension Methods (Aug 2010)

Extension methods allow you to add functionality to existing types by adding new methods -- not subtyping required. Here's a quick overview of how they work.

Quick Byte: Statement Lambdas (Feb 2010)

The first time I came across a lambda expression, I was perplexed. I could tell that something important was going on, but I got stuck on the new syntax. As I studied them some more, I had an "aha" moment, and it all clicked into place. This is a brief runthrough of that process with statement lambdas.

Target Practice - Silverlight 3 / XAML Sample (Sep 2009)

XAML has intrigued me ever since I took a close look at it. Previously, I created an entire WPF application using only XAML (it's trivial, yet functional). When I got started with Silverlight 2, I wanted to replicate that application. Unfortunately, there were limitations to Silverlight 2 (such as a lack of triggers) that kept me from implementing it. Silverlight 3 allowed me to implement the application entirely in XAML.

Silverlight 3 / Visual Studio 2008:

Data Templates & Value Converters - Silverlight 2 (Jun 2009)

Here's a few more useful things that I've come across. This time, it's Data Templates (which make List Boxes extremely flexible) and Value Converters. Note: this is applicable for Silverlight 3 as well (although Silverlight 3 does have some additional features that makes this easier).

User Controls and Events - Silverlight 2 (Jun 2009)

This demo shows how to split out a section of your UI as a user control. We'll also add an event to the user control that the other controls can hook into. Note: although this application uses Silverlight 2 (and Silverlight 3 has better ways of implementing this particular scenario), the concepts of eventing are still useful in other contexts.

Silverlight 2, WCF, and Lambda Expressions (May 2009)

This is an introductory demo in creating a WCF service and consuming it with a Silverlight 2 application. In addition, we'll take a look at the various ways of creating the call backs for the service (Event Handlers, Anonymous Delegates, and Lambda Expressions) and the various advantages of each. Note: this demo is applicable for Silverlight 3 as well.

Target Practice - WPF / XAML Sample (Mar 2009)

XAML has intrigued me ever since I took a close look at it. In this demo, the goal was to create an entire application using only XAML. This application is somewhat trivial, but it shows the power and flexibility of XAML and declarative programming.