c# - How to implement the MVVM pattern in a WPF project using GraphSharp / QuickSharp library -
c# - How to implement the MVVM pattern in a WPF project using GraphSharp / QuickSharp library -
note: newbie in fields involved (wpf, mvvm pattern, graphsharp/quicksharp libraries).
i trying display simple directed graph using graphsharp library. went through this demo, , wrote similar code (creating custom vertex, edge, graph , graphlayout types etc.).
next, added status property custom vertex type , implemented info template , style resource in xaml code (somewhat similar demo linked above), applied various styles vertex controls based on status property. this, had implement inotifypropertychanged interface in custom vertex type. have other codes alter status property of vertexes @ runtime, triggering style changes. works, far, good.
next read couple of articles how wpf code should organized model, view model , view layers: view (preferably xaml code) should talk view model classes (via bindings), latter implementing inotifypropertychanged , view model should talk "business logic" implemented in model classes. sounds nice, i'm pretty confused belongs where:
the xaml code view, far it's simple.
the custom graphlayout type seems belong view model layer.
i'd guess custom vertex, border , graph types belong model layer. except custom vertex type implements inotifypropertychanged, seems trait of view model classes.
the code changing custom vertex's status property makes utilize of quickgraph base of operations classes funcionality (bidirectionalgraph.outedges() example), should belong model layer. but: if custom graph belongs view model, why model class phone call view model class determine that's related business logic.
so main question is: preferred class construction programme this? classes belong model, view model , view layers?
c# wpf mvvm quickgraph graph-sharp
Comments
Post a Comment