Shimmy on .NET
Ideas and thoughts about .NET and related geeky material by Shimmy Weitzhandler
Sign in
|
Join
|
Help
Home
Contact
About
RSS
Atom
Comments RSS
Search
Tags
.NET
ADO.NET
C#
Cast
Convert
DataAnnotations
Date
DbContext
DEV
Dictionary
EDM-Designer
EDMX
Entity Framework
Entity Framework 4.1
Entity Framework 5.0
Expression Tree
Extension Methods
Hebrew
ICloneable
IDictionary
Jewish
LINQ
MVVM
ObservableDictionary
OFFTOPIC
Prism
RIA
RIA-Services
Silverlight
Silverlight-4
Silverlight-5
SQL
SQLCE
string
Text
Type-Conversion
Unique-Constraint
ValidationAttribute
VB.NET
VB10
View
ViewModel
Visual-Studio-2010
WinRT
WPF
XAML
News
Navigation
Home
All Posts
RSS
Popular Tags
Archives
May 2012 (2)
March 2012 (2)
February 2012 (2)
January 2012 (4)
October 2011 (1)
May 2011 (2)
April 2011 (1)
March 2011 (2)
December 2010 (2)
September 2010 (1)
August 2010 (3)
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...
תגים:
XAML
,
DEV
,
Silverlight-5
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...
תגים:
DEV
,
Dictionary