C#

C# Snippet Tutorial - Determining if Aero is Enabled


Posted in:

Recently I was working on a project and the UI required minor tweaks depending on whether or not Aero was enabled. Fortunately, I came across an MSDN forum topic with the solution, so I thought I'd share.

Read More Icon Read More

WCF Snippet Tutorial - Overloading Methods


Posted in:

This snippet will show you how to add overloaded functions to your WCF service contracts.

Read More Icon Read More

C# Tutorial - Using the BackgroundWorker Class


Posted in:

It's a rule that should never be forgotten - don't ever perform work that takes a non-trivial amount of time on the UI thread. Of course you're now wondering, "Where do I perform tasks that take a non-trivial amount of time?". The answer is simple - on a different thread. There are lots of ways to get your work onto another thread, which can include directly creating a Thread or using the ThreadPool.

Read More Icon Read More

Creating a REST Client using WCF


Posted in:

A couple of weeks ago we received an email about consuming a REST service in WCF. Well, this tutorial should answer that email. Today we're going to build a simple client for Twitter's REST API using WCF.

Since it doesn't look like WCF natively support OAuth authentication, the client we're going to write will do one simple thing - request the latest status updates for a specific user. I'm going to write a command line application that asks for a username and then prints a bunch of status updates along with information about the user. Below is some example output.

Read More Icon Read More

Silverlight Tutorial - Animating Elements using Render Transforms


Posted in:

What started out as a tutorial about Silverlight 3's new BitmapCache feature has turned into something a little simpler. The documentation clearly states that render transforms will be hardware accelerated when bitmap caching is enabled, but I couldn't get it to work. It wasn't a total waste, however, as I did create an application that illustrates how to animate an object using render transforms, which is probably one of the fastest ways to animate an element's visual state.

Read More Icon Read More

Silverlight - Basic Movement with Animations


Posted in:

So what do you need to make a game with Silverlight? Well, at the most basic level, you need something that moves around the screen. At the most basic level, four buttons that move a sprite in four directions. How do you do that? Well, there are multiple ways to accomplish this movement, some more flexible than others. Today, we are going to using Silverlight animations to do that job.

Read More Icon Read More

Silverlight 3 - An Out Of Browser Example


Posted in:

One of the many new things available in Silverlight 3 is the ability to create out-of-browser applications. At first glance, this new out-of-browser capability sounds like it is Microsoft's duplicate of Adobe AIR, but for a number of very important aspects, the two are completely different. In fact, Silverlight's out-of-browser ability has more in common with Mozilla's Prism or Google Gears.

Read More Icon Read More

Silverlight 3 Tutorial - PlaneProjection and Perspective 3D


Posted in:

Silverlight 3 has unleashed a host of new features available to us developers, and one that should provide a new level of user interface design is the introduction of perspective 3D. This features allows us to apply projections to any UIElement to give the appearance of 3 dimensions. In this tutorial, we're going to build a simple flipbook that lets users flip through images as if they were turning the pages on a book.

Read More Icon Read More

Silverlight 3 - Using Local Connections


Posted in:

One of the nifty new features available in Silvering 3 is the Local Connection API. This makes it extremely easy to communicate between two different Silverlight applications. Granted, you could communicate between Silverlight instances before, but you had to use Javascript as a go-between. Now, it is much, much simpler, and as an added bonus, Silverlight apps can communicate from different browser pages! An app loaded in one browser tab can (with the right permissions) communicate to one on a different tab. Pretty cool, eh?

Read More Icon Read More

Using Control to Control Binding in Silverlight 3


Posted in:

One of the new features in Silverlight 3 is enhanced binding abilities, this includes the ElementName property. What this allows you to do is bind values from other controls. While this is new to Silverlight, the desktop environment has had this for a while so you may have seen this before. However this feature is extremely useful for many different applications. This tutorial is going to show how to use this feature in a simple way.

Read More Icon Read More

Sponsors