DCSIMG
May 2011 - Posts - Shimmy on .NET

May 2011 - Posts

1
Comments

TIP: Silverlight 5 Beta IMarkupExtension<T> and StaticExtension by Shimmy

In WPF, there is the well known StaticExtension . However Silverlight users are struggling in finding quirky workarounds to this missing feature. Now, in Silverlight 5, Microsoft introduced the IMarkupExtension<T> interface. This one, not only reflects to the WPF MarkupExtension , but also is a generic interface rather than a class. The MarkupExtension abstract class features only one method ProvideValue , this is a huge disadvantage, since you cannot inherit from multiple classes, and if you...
1
Comments

TIP: Dictionary<Type, T> - Use generic type argument as keys by Shimmy

When you want to store items by known types using the type as the key, you could add some methods to the Dictionary<,> class to make this work the generic way. It basically does nothing but does the typeof ( MyType ) for you. Note: Didn't test performance impacts. using System . Collections . Generic ; namespace System . Collections . Specialized { public class TypeDictionary < TValue > : Dictionary < Type , TValue> { public TValue Get < T >() { return this [ typeof (T...
תגים:,
Powered by Community Server (Commercial Edition), by Telligent Systems