Sunday, October 14, 2012

Partial classes in MonoDroid

While developing some applications recently I have been reminded that C# partial classes are a brilliant way of saving you the stress of navigating a file that contains implementations for many different things.

Many Android view classes can implement interfaces that soon make the file large and difficult to navigate. A few partial class declarations to separate out the variables and implementations associated with each of the interfaces makes the code navigation so much simpler.

Great example candidates being implementation of geolocation features or other sensor inputs.

Of course, this applies to all code that you may write in C# but as my focus is on Android development today it seems to be worth a mention.

No comments: