Archive of ‘C#’ category

Request throttling in ASP.NET Web API

Real world scenario When you start to build real world REST API you will surely try to limit access to you API. You can limit number of concurrent requests by using or some other tools. In this post I will try to limit access to my ASP.NET Web API by using my own code […]

ASP.NET Web API Authorization using Tokens

Planning real world REST API When you try to plan how to build real world REST API like other major players like Facebook or Foursquare have you will soon realize that all major players use OAuth 2.0 . ASP.NET Web API comes with support for authorize attribute and that’s nice, but for real world API […]

Force JSON DelegatingHandler for ASP.NET Web API

 Building real world REST API-s When you decide to build real world REST API-s like Facebook or Foursquare and many others have you must think on lot of things such as security, scoping, throttling and similar. One of the first thing you will encounter is need to support various media formats such as JSON, XML, […]

ItemClick event on Silverlight ItemsControl

Recently I have been playing with Rik Robinson’s project called Silverlight 2 Scroller. You can read more about this control on this address : After looking at ItemsControl I have realize that you probobly want to implement click event when user click on your item in ItemsControl.ItemsControl is widely used in Silverlight.I have little […]

SqlException class does’nt have public constructor

I am currently preparing 3.5 course so I try to throw SqlException in one of my examples and realize that SqlException class is sealed and has no public constructor. I have found solution on Rido blog how to create SqlException using reflection.         public static SqlException CreateSqlException(string errorMessage, int errorNumber)         […]

Silverlight chat application using WCF full duplex

Last week I have been started to read about full duplex wcf and his implementation in silverlight applications.I have read tons of articles on MSDN and tons of blog and forum posts. Recently I have found solution for chat application on this blog so I have little modified that application but it is basically […]

MVVM pattern in Silverlight using SLEextensions

In this  article I will explain how to implement MVVM pattern in Silverlight. I was very overjoyed when I was reading my friends article on Codeproject about MVVM pattern in WPF . You can check this article by Miroslav Popovic on I have decided to try implement same pattern in Silverlight .After reading and […]

Styling silverlight datagrid control

This article will explain you how to  modify default silverlight datagrid control look. In this example I have created new silverlight application project and add datagrid control in xaml file.I have also created small class called Person to populate test data.  public class Person { public int ID { get; set; } public string FirstName […]

Silverlight supports fullscreen mode

Silverlight 2 has build in support  for fullscreen mode.This feature can be very interested for building same online game solution or some cool video players or …When we enter to this fullscreen mode everything is hidden including browser frame. We can also resize our application to fit new changed screen size using two events in […]