@@ -260,7 +260,7 @@ private static DependencyProperty RegisterCommon(string name, Type propertyType,
260260 FromNameKey key = new FromNameKey ( name , ownerType ) ;
261261 lock ( Synchronized )
262262 {
263- if ( PropertyFromName . Contains ( key ) )
263+ if ( PropertyFromName . ContainsKey ( key ) )
264264 {
265265 throw new ArgumentException ( SR . Format ( SR . PropertyAlreadyRegistered , name , ownerType . Name ) ) ;
266266 }
@@ -765,7 +765,7 @@ public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata
765765
766766 lock ( Synchronized )
767767 {
768- if ( PropertyFromName . Contains ( key ) )
768+ if ( PropertyFromName . ContainsKey ( key ) )
769769 {
770770 throw new ArgumentException ( SR . Format ( SR . PropertyAlreadyRegistered , Name , ownerType . Name ) ) ;
771771 }
@@ -991,7 +991,7 @@ internal static DependencyProperty FromName(string name, Type ownerType)
991991
992992 lock ( Synchronized )
993993 {
994- dp = ( DependencyProperty ) PropertyFromName [ key ] ;
994+ dp = PropertyFromName [ key ] ;
995995 }
996996
997997 ownerType = ownerType . BaseType ;
@@ -1198,7 +1198,7 @@ private enum Flags : int
11981198 /* property */ internal static ItemStructList < DependencyProperty > RegisteredPropertyList = new ItemStructList < DependencyProperty > ( 768 ) ;
11991199
12001200 // Synchronized: Covered by DependencyProperty.Synchronized
1201- private static Hashtable PropertyFromName = new Hashtable ( ) ;
1201+ private static readonly Dictionary < FromNameKey , DependencyProperty > PropertyFromName = new ( ) ;
12021202
12031203 // Synchronized: Covered by DependencyProperty.Synchronized
12041204 private static int GlobalIndexCount ;
0 commit comments