properties - WPF DependencyPropeprty -
i beginner. question regarding construed following link regarding local value resolution of dependency property
http://wpftutorial.net/dependencyproperties.html
it explained in "the magic behind it" section within webpage pointed link local value, if exists, resolved using key against dictionary lives static dictionary within control. key in dictionary unique per type (e.g., button). please correct me if wrong, understanding, there 2 dictionaries, 1 key , "metadata contain callbacks , default value" , key , value of property.
for sake of better explaining question, let's assume have wpf application 2 buttons , dependency property in question "background". in case, if both of buttons have 2 different backgrounds set local value, should end 1 key/value in first dictionary (key , metadata), , 2 key/value in second dictionary (where background values stored). , here comes question, if key "must unique per type", how in second dictionary 2 different keys, each of distinct background value, corresponding 2 buttons ? is, don't both buttons have same key key unique per type (i.e., both buttons have same type)?
can tell me confusion ?
there many dictionaries, not two. not dictionaries. hashsets. top dictionary has key value pair key unique per control type , value unique per defintion. inside value maintainings happening. dependency properties pretty smart , fast example if have 100 buttons same color there 1 background color stored under hood. pretty comlicated , clemens suggested maybe should inspect framework if want know more. if new wpf dont that. use , once not working post question here. dps under hood nothing newbie. takes alot of wpf knowledge understand why dps implemented way are.
Comments
Post a Comment