有一个包含一些相关对象的ViewModel(节点和线条(,如何在View中显示(同步)这些VM并保持对象连接。)我使用一些DataTemplate映射模型以查看,但是每个对象都将被同步(具有强大的绑定)到相关对象,但是我如何将这个DataTemplate生成的UI元素链接(和同步)我从另一个角度描述问题: 同步视图模型和视图
There is a ViewModel that consists of some related object (nodes and lines( , How it can be possible to display (synchronize) these VM in View and keep object connections. I use some DataTemplate to map model to view but each object would be synchronized (with powerful binding) to its related object but how can i link (and synchronize) this DataTemplate generated UI element together. I describe problem from another viewpoint here: Sunchronizing view model and view
推荐答案您可以使用中继命令逻辑来同步VM和视图。
You can synchronize the VM and View using Relaying Command Logic.
您可以在此处查看示例锻炼
you can see a sample workout here
使用MVVM在WPF中绑定窗口的 WindowState属性
更多推荐
WPF ViewModel无效的演示者
发布评论