I\'m working through Josh Smith\'s CommandSink code obviously do not understand something about the \"as\" keyword in C#.
I don\'t understand why he wrote the line:
What if the DependencyObject depObj was actually a FrameworkOtherTypeOfElement
DependencyObject depObj
FrameworkOtherTypeOfElement
Then depObj would not be null
depObj
but the attempted as Casts would both evaluate to null and _fe & _fce would both be null
as
_fe
_fce
as is equivalent to doing
if(I Can Cast This Object) //Then cast it else //Return null