Main difference is that casting to wrong type throw an exception and an “as” keyword just return null. So if I would like to search specified type in VisualTree I can use “as” keyword and check is object not null or I can use “is” keyword. But when I would like to take not reference object like generics KeyValuePair from object type I will have to use casting to unpack the value type. This is because value types do not inherit from object so they are not objects and cannot use keyword as.
To get TemplateChild from DataTemplate use FindName method. In my opinion more adequate name is FindByName.
If there is no need to change freezable object anymore, always remember to call freeze method.