hendra.dev

A work in progress

Data Binding in .NET

I am now trying to use the concept of MVVM in my applications, as I believe a proper separation of concerns is very important in building an application, as from I personally experienced when developing in PHP with CodeIgniter, it really makes development much easier.

Threading in C#

Well, this time, I am going to talk about thread, the concept of thread is pretty simple to understand, so I wont explain the here, but you can read more about it in this wiki page.

Implicitly Typed Language and Anonymous Types in C#

In C#, there is this var keyword, which allows you to declare a variable without explicitly specifying its data type. It is important to note, that this doesn’t mean that it is dynamically typed, it simply means that the compiler will infer the data type for you, and it is also important to note, that it is strongly typed.

Lambda Expression with C#

Previous in my post regarding delegate, I talked a little about anonymous method that can be used with delegates, there are other forms to declare inline functions. Both of them are collectively known as anonymous functions of C#.

Events in C#

Alright, last time I posted about Delegate, and together with event, they are one of the most important concept to understand in event driven application framework, such as WPF, Silverlight, and Silverlight for WP7, and maybe even WinRT as well (I haven’t tried it), so I believe it is important to understand how it work, especially when these two are pretty closely related.

Some Stuff I Didn’t Know About String in C#

Well, its a bit strange getting to know something that I’ve used extensively for quite a while, but there are indeed some things that feels revealing. First of all, I knew that strings is a little bit special, in a way that it is a reference type, but it behaves very much like a value type, for example:

Some Standard C# Object Methods That You Might Want to Override

Alright, I’ll get it straight to the point, since this is just a note to myself anyway, First one, the ToString() : :::csharp class YourClass{ private string name; private int age; public override string ToString() { return "Name: "+this.

C# – Optional Arguments and Constructor Chaining

Learned something new about C# today, first thing is Constructor Chaining. Constructor chaining enables constructors to call another overloaded constructor, with it, the amount of duplicate code can be reduced significantly, here is an example:

Javascript – Setting Events to Unique Anonymous Functions

Ok, the easiest way to convey my point is with code, so: :::javascript function foo(bar){console.log(bar);} for(var i=1;i<5;i++){ $('someDiv'+i).onclick=function(){foo(i);}; } Say you are trying to set the onclick event of an array of elements in your page, and each of these events need to trigger the same function, but passing different parameter, seems simple enough, but if you try to run the code above, all of the click events will print the value 5.