Silverlight MVVM中的图表-连接形状 [英] Diagramming in Silverlight MVVM- connecting shapes
问题描述
我对用例diagarm中的MVVM模式有疑问.
have I have a quesition regarding MVVM pattern in the use case diagarm.
到目前为止,我的列表是我的形状的项目列表.
What I have so far is a list of Items which are my Shapes.
ObservableCollection<ItemsViewModels> Items;
和项目连接集合
ObservableCollection<ConnectionViewModel>
每个ItemViewModel都有一个ID,而ConnectionViewModel有两个ID来连接Items.
Each ItemViewModel has an ID and a ConnectionViewModel has two ID to connect the Items.
我的ItemsViewModel集合绑定到Items控件,该控件是Canvas上的布局.
My ItemsViewModel Collection is bound to a Itemscontrol which is layout on a Canvas.
使用ElementMouseDragBehavior,我可以拖动我的物品. 现在是我的大问题=) 如何可视化我的连接,使我能够移动这些项目,并且这些项目保持与直线或贝塞尔曲线的连接.
With the ElementMouseDragBehavior I am able to drag my Items around. Now comes my big question =) How can I visualize my connections that I will be able to move the items around and the items stay connected with a line either straign or bezier.
我不知道如何使用mvvm模式将其抽象化.
I don't know how to abstract that with the mvvm pattern.
感谢您的帮助...
推荐答案
这对您有用吗?:提供了来源,其中列出了以下功能
Source is provided and it lists the following features
- 添加,删除,重命名节点
- 拖动节点
- CTRL +拖动以拖动子树/分支
- CTRL +在画布上拖动以平移
- 使用VSM进行选择和悬停
- 带有动画的简单自动布局
可能与您所追求的不完全相同,但这可能会为您提供一个起点.
Might not be exactly what you were after but it may give you a starting point.
约翰
这篇关于Silverlight MVVM中的图表-连接形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!