We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn MoreHave 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: }
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:
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 [...]
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd