http://social.msdn.microsoft.com/Forums/en/wpf/thread/a3eedc3e-0d59-420c-aba0-44fe8b00552f'rel=“nofollow noreferer”http://social.msdn.microsoft.com/Forums/en/wpf/thread/a3eed3e-0d59-420caba0-44fe8b00552f。
但是,我并不真正了解注射的含义(如下文所述):
an interface to the UserControl public model called IUserControlModel. It has the properties that should be visible from outside;
- a UserControlViewModel that contains a public property of type IUserControlModel that is injected in the constructor; plus all the properties used for XAML binds specific to the usercontrol implementation; XAML may have binds directly to the IUserControlModel properties too;
- a MainWindowViewModel that nests the IUserControlModel inside.