Windows Phone Developers

Saturday, March 27, 2010

Partial Classes in C# (.NET)

Why to use Partial Classes?

Partial classes have many advantages. The most visible being the ability to split the class in multiple files. This is quite evident in Windows forms.

Windows forms has the class being split between two files - Form1.cs and FormDesigner.cs

Windows Forms application

partial class




/// Required designer variable.


private System.ComponentModel.IContainer components = null



public partial class

Form1 : Form








The same concept can be effectively used in the classes you create also.

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment :: Visual Studio 2005 :: Visual Studio 2008 :: Visual Basic 2005