Click here to Skip to main content
15,064,806 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi, I've recently started using the MVVM pattern in working with WPF. I have a collection of ViewModel classes which are displayed on the screen as UIElements (namely rectangles) and I want to be able to draw lines between these elements to connect them. The thing is that the line also represents another ViewModel object. now i've been able to get static sized lines to appear on the screen, but I want to be able to click a button or menuitem or something and draw a line from one rectangle to another and have them "connect" while at the same time create a viewmodel class that represents that connection. The connection should know what it's connecting also (e.g. start/end viewmodels).

Can anyone help me?
Keith Barrow 2-Aug-10 14:17pm
Does the business model really have a line (e.g. are you modeling some king of drawing app or something like visio)?
If not, then IMO this is not part of the model and should just be represented in the View/ViewModel, doing this would separate the concerns more clearly.
industryunleash 4-Aug-10 10:55am
yes i am modeling a drawing app like visio, the lines actually represent interactions between systems in the model

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900