本文介绍了WPF ViewModel无效的演示者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个包含一些相关对象的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

这篇关于WPF ViewModel无效的演示者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 05:22
查看更多