Hi Walter, hope you are doing well, please see my issue.
I made a small demonstration application which looks like this:
On the left side, i set a go:Diagram as direct content, and on the right side i set the content with a DataTemplate which contains a go:Diagram.
For both, i used the same XAML code and within the XAML code, i also set my tools, for example a ClickCreationTool which creates a node on double click.
The problem is, that on the left side, all is working good, but on the right side, not a single tool is working. - The only difference is, that i use a DataTemplate.
I have to develop MVVM applications, and using DataTemplates is more less the state of the art way to go. - It seems like, there is a problem in GoXAM to work properly when used within DataTempates.
Please see my sample:
HannesHold/GoWPFDataTemplateIssue: GoWPF DataTemplate issue demonstration (github.com)
Currently, the only solution which i got to run correctly is, to make a CustomDiagram and creata all the tools needed, which are also CustomTools, within the constructor. - This means i have to do all in code behind, even have to set tool’s bindings, tool’s templates e.g. BoxTemplates in code behind of the tool’s constructor itself and so on.
I personally think this is a huge issue. - Can you please have a look at this, and let me know why GoXAM has this problem? - Maybe i am simply doing something wrong, and you will teach me better soon. - Many thanks meanwhile, Hannes