Unknown Recipes
-
Recursively Traversing IEnumerable<T>
Most of the samples I saw about traversing an IEnumerable<T> use recursion, this can cause some overload in the stack depending on the hierarchy depth. The version I propose use a Queue<T> to achieve the same; note that this is I a common algorithm named Breadth-first search, and note that you can use a Stack<T> instead to turn to Depth-first search algorithm. Here you have the extension method:
-
Getting the default value for a Type
Sometimes we need to get a default value for an specific type but we only know the type in runtime, then we can not use default(T). One way to do this is to use a simple extension method:
-
How to implement Property Changed notification in WPF with a base ViewModel
Implement property changed notifications is tedious, there are some posts about how to implement it in a strongly-typed way. I decided combine that technique with a way to simplify the implementation of the setter.
-
Add Service Reference from SO-Aware
We have recently included a very cool feature to automatically create WCF service references (or service proxies) within Visual Studio 2010 from the SO-Aware repository. After running the installer, you will be able to find a "TellagoStudios.VisualStudio.Editors.SOAware.vsix" extension within "C:\Program Files (x86)\Tellago Studios\SO-Aware\SDK\Visual Studio\" to register this plugin in your Visual Studio instance.
-
SO-Aware released – WCF Repository
Tellago Studios, the company where I am working on, released a great new product called SO-Aware. This is basically a WCF Service Repository that keeps all the configuration centralized.
-
MOQ 4.0 Beta 3 Released
We released MOQ 4.0 Beta 3. It was compiled for .NET Framework 3.5 & 4.0 and Silverlight 3 & 4.
-
Sorting a ListView in WPF – Part II
Some time ago I wrote a post about how to sort a ListView by clicking on the header of the column. The problem with that solution was that you needed to implement it each time and you have to define an explicit header for each column.
-
MOQ 4.0 Beta 2 released
We released MOQ 4.0 Beta 2, it includes some fixes over the previous version and the update to DynamicProxy 2.2. It was compiled for .NET Framework 3.5 & 4.0 and Silverlight 3 & 4.
-
Disabling Minimize and Maximize buttons in a WPF Window
In WPF there is no possibility to control when the Minimize and Maximize buttons are disabled when the WindowStyle is SingleBorderWindow or ThreeDBorderWindow. In Windows Forms there are some properties like ControlBox, MinimizeBox and MaximizeBox that allow to do that.
-
C# Code Snippets for properties raising PropertyChanged event
I decided to publish the snippets I use to implement properties that raise the PropertyChanged event. There are two code snippets, one generates a property raising the event, it is called by typing propnpc in the code editor, and generates the following code: