开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜