Monday, February 23, 2015

Visual C# Technical Guru - January 2015

Became the Visual C# Technical Guru for the month of January, 2015. Nowadays there is a lot of competition going around with the TechNet Wiki Guru awards and I am glad to win the Gold after couple of months.

The TechNet Guru Awards celebrate the technical articles on Microsoft TechNet.

Post in WikiNinjas Official Blog,
http://blogs.technet.com/b/wikininjas/archive/2015/02/20/the-microsoft-technet-guru-awards-january-2015.aspx

image
Visual C# Technical Guru - January 2015
Happy Coding.

Regards,
Jaliya

Monday, February 16, 2015

Partial Interfaces in C#

Not only classes, structs or methods can be declared as partial. We can define interfaces as partial as well. If you want to learn more about partial classes, do read my previous post about partial classes in the context of Portable Code Strategies for Windows Store and Windows Phone 8 App Development. The concept is pretty much the same when comes to partial Interfaces and here is how we define partial Interfaces.
partial interface IMyInterface
{
    void MyMethod1();
}
 
partial interface IMyInterface
{
    void MyMethod2();
}
 
public class MyClass : IMyInterface
{
    public void MyMethod1()
    {
        Console.WriteLine("Called MyMethod1");
    }
 
    public void MyMethod2()
    {
        Console.WriteLine("Called MyMethod2");
    }
}
Here I have the Interface IMyInterface which I declared as partial and I have a class named MyClass which implements it. In my class I am implementing  both MyMethod1 and MyMethod2 just as I would do for implementing non partial Interfaces. And I can invoke the methods as follows.
static void Main(string[] args)
{
    IMyInterface myInterface = new MyClass();
    myInterface.MyMethod1();
    myInterface.MyMethod2();
}

Pretty simple, isn’t it.

Happy Coding.

Regards,
Jaliya

Saturday, February 7, 2015

Session : Universal Windows Application Development at Imagine Camp Workshop Held at Informatics Institute of Technology (IIT), Sri Lanka

Today delivered a two hour session about Universal Application Development at Imagine Camp Workshop Held at Informatics Institute of Technology (IIT), Sri Lanka. All of the participants were students at IIT who are developing applications to be a winner of Imagine Cup.

In this session, I have started the things from very scratch giving an introduction to what's new in the Windows Runtime Application Development ecosystem. Then the whole session was full of demos, from the basics of MVVM to creating of Universal Apps using Visual Studio Universal Apps template. Under MVVM, I have demoed use of ObservableCollection<T>, INotifyPropertyChanged, ICommand etc.. I have also demoed the different code sharing strategies such as Portable Class Libraries, use of partial classes, partial methods and abstract classes etc..



I am uploading the sample code and slide deck to my OneDrive. Do check them out!.


Happy Coding.

Regards,
Jaliya

Thursday, February 5, 2015

Session : Building Universal Apps for Windows and Windows Phone at Sri Lanka .NET Forum

We've been hearing about Microsoft's vision of universal apps for years, apps that can be written once and run on a wide variety of devices. But with Windows 10 it's finally becoming a reality. So as universal apps is becoming the future of windows development, delivered a session today at Sri Lanka .NET Forum preparing the .NET community in Sri Lanka to face the new universal app challenge.

Since the most of the participants were new to Windows Runtime Application development, had to brief and demo the audience on MVVM and how we can create a very simple Windows Phone Application using MVVM pattern. Then stepped in to the real topic, starting explaining the strategies (such as “Linked Files, Portable Class Libraries”) that can be used to create apps which targets both big Windows and small Windows while having the same code base using C#.

Then wound up the session showing the Universal App Template in Visual Studio and how it can be used to develop apps for big Windows and small Windows.



Slide deck is also uploaded to my OneDrive.

 
 
Happy Coding.
 
Regards,
Jaliya