WPF Canvas - Visual Studio, e.g. split view

I am working on an application that displays huge (10000+ elements) graphics in wpf canvas. I need a function, for example, in Visual Studio, when you can split the editor view (so that I can view two remote parts of the same graph at the same time).

I have some limitations:

  • data binding (creating bindings) of graph elements makes loading large graphs very slow, so I do not use MVVM, the "virtual machine" knows about the presentation and updates it directly if necessary
  • canvas children are structure elements since I use the Tag property
  • due to the number of graph elements, I do not want to save two different views for each element for two parts of a divided view

Thus, it should be like displaying several parts of the same canvas in different places. You cannot set two parents for FrameworkElements in WPF, so the easiest way is out of the question :(

What are my options? Should I review my limitations or is there a workaround for this?

Let me know if you need any details (this is a great application, so I cannot provide you with every information).

Edit : Duplicating with a brush is not an option, as I need the right event notifications, so both views should be editable.

+4
source share
1 answer

Options:

  • Bind the same data to two controls.
  • Use a visual brush and duplicate input for the real control.
  • Create a custom graphics control that can display two parts of the chart at once.

If the binding to the two controls is too slow, I think you need to rethink your application. The fact that you have so much data displayed right away that you need a double view to see the individual parts is disturbing. This should raise a red flag. The red flag will notify you: "What I need and what I have different." And you have to go back to the drawing board and find out what you really need.

Otherwise, it’s best to create a custom control. The graph is a complete rendering, even if you only need small fragments. If you have your own custom control, you can speed up the entire application by displaying only the visible parts at a time and splitting inside the control.

+2
source

All Articles