简体   繁体   English

如何在WPF中绑定两个散点图(MVVM,ViewModel-First)?

[英]How to bind two scatter charts in WPF (MVVM, ViewModel-First)?

How to bind scatter series points from one window to another window having same scatter chart at runtime? 如何在运行时将散点系列点从一个窗口绑定到具有相同散点图的另一个窗口?

I have a resulted scatter chart points in one window, and I want to perform different operation on the same points in another window. 我在一个窗口中有一个散点图结果点,并且我想在另一窗口中的相同点上执行不同的操作。

thanks in advance 提前致谢

If you are using MVVM, you can bind the source of your scatter charts to a property in a viewmodel/class. 如果使用的是MVVM,则可以将散点图的源绑定到视图模型/类中的属性。

For example: 例如:

private Series _plotVariable;

public Series PlotVariable
{
   get
   {
       return _plotVariable;
   }
   set
   {
       _plotVariable = value;
   }
}

If you bind the source of your scatter charts to PlotVariable, when your class sets the value of _plotVariable, the scatter charts will update. 如果您将散点图的源绑定到PlotVariable,则当您的类设置_plotVariable的值时,散点图将更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何动态绑定两个ViewModels的公共属性? (MVVM,ViewModel-First) - How to bind a common property of two ViewModels dynamically? (MVVM, ViewModel-First ) 如何使用ViewModel-First方法? - How to use the ViewModel-First approach? 如何在WPF MVVM中将View变量绑定到ViewModel? - How to bind Variables of View to ViewModel in WPF MVVM? WPF/MVVM:如何从 ItemsControl 将模型绑定到视图/视图模型 - WPF/MVVM : How to bind model to view/viewmodel from ItemsControl 如何将View控件正确绑定到ViewModel列表(WPF MVVM) - how to correctly bind a View control to a ViewModel List (WPF MVVM) 如何在MVMVM WPF中绑定父项或其他ViewModel属性 - How to bind parent or other viewmodel property in mvvm wpf WPF MVVM:如何将GridViewColumn绑定到ViewModel-Collection? - WPF MVVM: how to bind GridViewColumn to ViewModel-Collection? 如何将列 header 绑定到 ViewModel 中的属性? (WPF MVVM) - How to bind column header to property in ViewModel? (WPF MVVM) MVVM-WPF如何将我的视图绑定到我的Viewmodel? - MVVM - WPF How do i bind my View to my Viewmodel? WPF MVVM - 如何将两个变量从与第一个 window 关联的 ViewModel 传递到与第二个 window 关联的第二个 ViewModel? - WPF MVVM - How can I pass two variables from the ViewModel associated with the first window to the second ViewModel associated with the second window?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM