visual3d as a view in prism mvvm scenario
I am trying to create a 3D editor and I am using Prism as my application framework. I wanted a Viewport3D to be a region for my views, and individual trees of Visual3D object to be the views themselves.
The standard way of attaching a view-model to the view is using DataContext. However, none of the Visual3D objects have data context. Therefore I do not have a good way of binding to my view-models. Anybod开发者_开发知识库y has encountered the problem? Any solutions beside re-architecting my application such that I don't use Visual3D as my views?
Alex.
Every UserControl has a DataContext property. Derive your 3D objects from the UserControl.
You can create your own custom class and DataContext property in it. You will not be able to enjoy the bindings out-of-the-box.
精彩评论