I'm currently working on an C# WPF application that allows you to create a graph (i.e. a bunch of vertices that are connected via edges) and then use this graph as a pattern to find it in a bunch of other (larger) graphs ("host" graphs). Each graph element has at least a type and a label.
The pattern graph elements (edges and vertices) can have different "restriction types".
A vertex for example can have the restrictions "This vertex' label must be 'Vertex A'" or "This vertex' type must be in the set {Type A, Type B, Type H}".
For edges, the restriction types are a bit more difficult. An edge can be restricted to either be a "simple" edge or a "path" edge. A path edge between two vertices in a pattern graph can be considered a placeholder that allows you to find multiple edges (and vertices) between the two vertices in a host graph. In contrast, a simple edge allows you to find only one edge (and no additional vertices) in a host graph.
If an edge has a path restriction (instead of a normal edge restriction) it has some additional properties like minimum path length or allowed vertex types that are allowed on the path.
The type restriction structure can be seen in this UML class diagram:
~~~
Now from the UI point of view: A user should be able to configure if a edge has a path restriction. If it has, the neccessary additional controls (TextBoxes, ListBoxes etc.) for the additional settings should automatically appear. Changes in all controls should automatically be reflected in the data structure.
Here's what the user interface should behave like when changing settings of a selected edge:
(Actually, on the right side there should also be a scroll bar on the right side that allows you to scroll down and configure also the allowed edge types on the path. Also ignore the vertex and edge overlap settings for now.)
~~~
Finally, my questions boil down to:
How do you implement such a dynamic object class change while maintaining WPF's data binding elegancy? (With dynamic object class change I mean that by clicking on the "Consider this edge as a path" checkbox the selected edge will get a different restriction type.)
Do I really have to create an old-school event listener that gets triggered when changing the value of the "Consider this edge as a path" checkbox and use it to update the visibility of the other sidebar controls "manually"?
Would it help in any way if I changed my restriction class structure somehow?