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
.NET 4
ADO.NET
ASP.NET MVC
C#
char
Code-First
DataAnnotations
DatabaseInitializer
Data-Binding
Date
DbContext
Designer
DEV
Dictionary
dynamic
Eager Loading
EDM
EF
Entity Framework
Entity Framework 4.1
Enum
Event
Expression Tree
Extension Methods
Garbage-Collector
GC
Generics
hardcoded
Hebrew
icloneable
IDictionary
IMarkupExtension
Include
IsNull
Jewish
LINQ
markupextension
Model-First
MVVM
My Namespace
Nullability
ObjectContext
ObjectQuery
ObservableDictionary
OFFTOPIC
Performance
Prism
Readability
Reflection
RequiredAttribute
RIA
RIA-Services
Silverlight
Silverlight-4
Silverlight-5
SQL
SQLCE
SQL-Compact
StaticExtension
string
Strongly-typed
Text
Tip
Type-Arguments
UniqueAttribute
Validation
ValidationAttribute
VB.NET
VB10
ViewModel
Views
Visual-Studio-2010
VS2010
VSIX
Window
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
,
markupextension
,
DEV
,
IMarkupExtension
,
Silverlight-5
,
StaticExtension
,
Tip
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
,
Generics
,
Type-Arguments
,
Tip