C#

WPF 4 Lowers Default BitmapScalingMode Quality


Posted in:

If you've recently upgraded a .NET 3.5 WPF application to .NET 4.0, you may have noticed that some of your images look like crap. This is because Microsoft has changed how WPF rescales images. Instead of the original high quality, it has been lowered to low quality. This was done, they say, to improve performance.

Read More Icon Read More

Loading XML Through XNA Content Pipeline


Posted in:

XNA is quite possibly one of the most robust game programming frameworks out there. You can do nearly anything with it, and one of the reasons it is so flexible is its "Content Pipeline". But sometimes it can be a bit tricky to use this feature, requiring us to do bit more work. But in the end, it helps to use the Content Pipeline. Luckily today we are going over how to use it to load in some XML.

Read More Icon Read More

WCF Tutorial - Serializing and Transmitting Base Types


Posted in:

By default, you cannot transfer an object as its base type between a WCF server and client. The DataContractSerializer will throw an exception when it attempts to serialize the base class, but instead finds your derived class. In this tutorial, I'm going to show you how to add attributes to your base class that will allow this functionality to exist.

Read More Icon Read More

C# Snippet Tutorial - The checked and unchecked keywords


Posted in:

Every once and a while I run across a new C# keyword that I've never used before. Today it's checked and unchecked. Basically, these keywords control whether or not an exception will be thrown when an operation causes a number to overflow.

Read More Icon Read More

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

Sponsors