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.


Design Patterns: Not Just for Architects

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? That's what we're here to find out.


Learn to Love Lambdas (and LINQ, Too!)

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: Understanding .NET Interfaces

Do you want code that's maintainable, extensible, and easily testable? If so, then C# interfaces are here to help. We’ll take a look at how we can use interfaces effectively in our code -- starting at the beginning ("What are interfaces?") and then exploring why we want to use them. Along the way we'll use existing interfaces, implement own interfaces, and take a look at dynamic loading, unit testing, and dependency injection. All of which is made easier with interfaces.


T, Earl Grey, Hot: Generics in .NET

Let the compiler work for you. Generics shift the burden of type-safety from the developer to the compiler. To understand Generics, we'll take a look at some .NET classes from the BCL (such as List), comparing the generic and non-generic versions. Then we'll add Generics to our own methods to add flexibility and type-safety.


DI Why? Getting a Grip on Dependency Injection

What is Dependency Injection? And why would we want to use it? That's what we're here to answer. We'll start by looking at the problems caused by tight coupling. Then we'll use some DI patterns such as constructor injection and property injection to break that tight coupling. We'll see how loosely-coupled applications are easier to extend and test. With a better understanding of the basic patterns, we'll remove the magic behind DI containers so that we can use the tools appropriately in our code.


Clean Code: Homicidal Maniacs Read Code, Too

There's no such thing as a write-once application. The world is constantly changing, and our code needs to change with it. We'll think in small pieces and take a look at some principles and techniques that will keep our code manageable and understandable. Think about the developer who will come after you. Now, imagine that he's a homicidal maniac who knows where you live.


Abstract Art: Getting Abstraction "Just Right" (Updated Oct 2014)

Abstraction is awesome. And abstraction is awful. Too little, and our applications are difficult to extend and maintain. Too much, and our applications are difficult to extend and maintain. Finding the balance is the key to success. The first step is to identify your natural tendency as an under-abstractor or an over-abstractor. Once we know that, we can work on real-world techniques to dial in the level of abstraction that is "just right" for our applications.


Practical Reflection in .NET(Jan 2014)

Reflection is an extremely powerful feature of .NET. But there is a big difference between what we can do and what we should do. Several of these features are useful to the everyday developer. We'll take a quick look at what reflection is capable of and then narrow our focus to practical uses -- balancing flexibility, safety, and performance.


Shields Up! Defensive Coding in C#

Coding is easy. Making sure our code is robust and effective takes a bit of effort. By coding defensively, we prepare our applications to face the challenges of real users in the real world. We'll go through some best practices to handle errors and exceptions, validate user input, and head off the common causes of memory leaks. Our ultimate goal is to provide an excellent experience for our users regardless of the circumstances.


TDD / Unit Testing / Smart Unit Tests (Jan 2015)

How do you get started with Unit Testing? A quick way is to implement some simple business rules using Test-Driven Development (TDD). This gives us a chance to understand the tools, see the importance of testing, and write code that is easy to test. We'll use Conway's Game of Life to help us get there. Tools will include MSTest, NUnit, and we'll even take a quick look at Smart Unit Tests -- a feature coming with Visual Studio 2015.


Getting Started with Git (Jun 2015)

We all need source control, and you may already be using a centralized source control system. But let's take a look at Git -- a distributed source control system that has 100% functionality without needing a network connection. We'll take a look at how to get started using Git, some of the useful features like branching and rollbacks, and we'll also see the built-in support that is provided in Visual Studio. After seeing how easy it is, you'll wonder why you haven't been using it all along.


Unit Testing Makes Me Faster: Convincing Your Boss, Your Co-Workers, and Yourself

Bosses hate unit testing. They see it as code that doesn't contribute to the final product. But here's the truth: unit testing makes us faster. We'll look at specific examples of how unit tests save time in the development process, whether we're creating UI-based applications or server-side libraries. With this in hand, we can show our boss how testing makes us faster and lets us move forward confidently and quickly.


Test-Driven Development in the Real World

Test-Driven Development (TDD) gives us a ton of advantages. It helps us think is small pieces. It helps us build provable code. And it helps reduce the amount of unneeded code that creeps into our applications. You've seen the simple examples of TDD such as building FizzBuzz or Conway's Game of Life. Those are great for getting started, but the real world is more complicated. We have to break down complex problems into workable solutions. We have to deal with services, libraries, and dependencies. And we have to deal with strange bugs that crop up. In this session, we'll go beyond the simple examples and see how we can use TDD effectively with real-world code. Along the way, we'll learn how to break down complexity, isolate dependencies with mocking, and capture expected exceptions.


Focus on the User: Making the World a Better Place

Our job as developers is to make the world a better place, whether it's connecting people, providing entertainment, or making someone's job easier. We have to know who we're building software for: our users. Understanding my users has been a key to every successful project I've worked on. I'll share some of my successes and some of my failures, and show how that's led to the approach to software that I take today. Together, we can provide our users with just what they need to make their world a bit better.


I'll Get Back to You: Task, Await, and Asynchronous Methods

There's a lot of confusion about async/await, Task/TPL, and asynchronous and parallel programming in general. So let's start with the basics and look at how we can consume asynchronous methods using Task and then see how the "await" operator can makes things easier for us. Along the way, we’ll look at continuations, cancellation, and exception handling.


Becoming a Social Developer: A Guide for Introverts

This is NOT a highly-interactive workshop. Now that you feel a bit safer, make the most of your time this week: talk to other developers. This is easy -- and incredibly terrifying. A few simple steps (and a bit of bravery) is all that it takes to get started. Building your developer network will boost your knowledge, your skills, and your career. Can an introvert become a social developer? YES! And we can do this while staying true to ourselves.


Getting Better at C#: Interfaces & Dependency Injection (Sep 2016)

Loosely coupled code is easier to maintain, extend, and test. Interfaces and Dependency Injection (DI) help us get there. In this workshop, we'll see what interfaces are and how they can add "seams" to our code that makes it more flexible and maintainable. From there, we'll dig into loose coupling with Dependency Injection. DI doesn't have to be complicated. With just a few simple changes to our constructors or properties, we can have code that is easy to extend and test.

If you're a C# developer who wants to get better with higher-level concepts like abstraction, loose coupling, and extensibility, then this is the workshop for you. We'll start by laying a good foundation and then ramp up throughout the day.


Getting Better at C#: Unit Testing Clinic (May 2016)

Unit testing can make you a faster developer. Good tests let us move forward more confidently, give us instant feedback when checking regression, and help us pinpoint bugs when things go wrong. In this workshop, we'll look at the qualities of good tests, including isolation, repeatability, runnability, and more. And we'll look at specific techniques that make our tests easy to ready, easy to write, and easy to run.

We'll go hands-on with TDD (Test-Driven Development) to see the red-green-refactor cycle in action. Some code is tricky to test: we'll look at how to test for exceptions and error states, and we'll use a mocking framework to create mocks and stubs. Tools include MSTest and NUnit (for testing) and MOQ (for mocking), but the skills easily translate to other frameworks.


Clean Code: Principles, Patterns, and Practices for Better Code (May 2014)

You already code. Now it's time to take the next steps to becoming a better developer. Those steps are not difficult; we just need to put them into practice. The end result is code that is easier to maintain, easier to test, and easier to extend. Through lots of examples and hands-on labs, we'll learn about software design principles and the patterns that help us implement them. We'll see how Dependency Injection helps us create loosely-coupled code. And we'll spend a bit of time looking at Software Craftsmanship: ensuring that our code is readable by humans while still easy to maintain and test.


Leveling Up: The Professional Coder Workshop (Sep 2014)

How can you create better software? What cutting edge practices can you employ to become a better professional? This workshop is a packed day of training and labs. Come experience how common design patterns, coding techniques and core concepts combine to make you more effective. More effective as an individual developer, more effective in a team, more insightful about how to go about things.


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 -- no 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.