WPF内反射的使用
目录
意想不到的反射应用
关于反射:
当你写 <TextBox Text="{Binding UserName}" /> 时,WPF 的绑定引擎(Binding Engine)底层就在拼命地使用反射。它需要通过字符串 "UserName" 去你的 ViewModel 里找对应的属性。你没有写 Type.GetProperty("UserName"),因为 WPF 帮你做了。