Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102
Posted by Amit on Jul 29th, 2008 | Filed under .Net, WPF | 8 Comments

Have you ever tried to create a DataTemplate for a Generic Class? During last week I had to battle this issue and it is allot more complicated then it sounds. As far as I can tell Creating DataTemplates for Generic classes is impossible. There is some kind of workaround but it is not all that good. OK lets get down to business. This is the class we are trying to template

   1: public class GenericClass<T>
   2: {
   3:     private T m_Val;
   4:  
   5:     public T Val
   6:     {
   7:         get { return m_Val; }
   8:         set { m_Val = value; }
   9:     }
  10: }


Continue Reading...
Posted by Shahar A on May 15th, 2008 | Filed under .Net, C# | 6 Comments

Did you ever need to convert List(T1) to List(T2)? One example might be when implementing an interface. you might need to expose a collection of other interfaces (or maybe the same interface), But you usually hold the concrete type implementing the interface in the collection. Lets look at the following example:


Continue Reading...
Posted by Amit on Jan 8th, 2008 | Filed under .Net, C#, Visual Studio | 1 Comment

Hi all.
In the course of my work i was in the need of a State Machine. i decided to implement a Generic version of the State Machine so I can reuse it if i will need it again. i started with defining the needs of a basic state and i can up with the [...]


Continue Reading...
Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More