Zero Touch Custom UI nodemodel

I am new to WPF and I am trying to create a simple toggle button in Dynamo.The sample Script I refereed is HelloDynamo (https://github.com/teocomi/HelloDynamo) .

I managed to get the node displayed in Dynamo, but currently the toggle doesn’t work , it always display false. I suspect there is a binding issue in WPF.

Node in Dynamo:
TrueFlase

Xaml File:
xaml

Main CS File:

Node View File:
NodeView

Thank you !

Springs has a button now. Might ask him,
image

How are you loading the WPF dlls? They can’t be loaded from within Dynamo. You have to load them from a package folder.

BTW @teocomi just publised a great ZT / WPF guide available in the last few days:

3 Likes

Thanks for sharing this, I was using the same method as Teocomi to create custom nodes, but something must went wrong on the wpf part which cause the error.

I solve the issue now, apparently custom Node assemble has to be separated from all the other assembles. I was put it together with some zero touch nodes which enables pop-out windows in dynamo, that somehow causes the problem.

Hey clover, when you mean separated, do you mean an entirely different solution?

Am playing with the ZeroTouch nodes, though they always disappear when I add in a custom node with in and out ports…

yes , custom node has to be in the different solution of the zero touch code .

Yea, thank goodness I stumbled on this thread.

Your work has got me to solve it.

Though I had both in the same solution, the DLL file mattered the most.

This was achieved by 2 steps:

  1. By changing the assembly name of the solution, managed to churn out a DLL with custom nodes, and a separate DLL with zero touch nodes. (csproj file / rightclick project > hit properties option > under applications tab > change assembly name)

  2. edit pkg.json file to add separate node_library parameter with name of other assemble / DLL.

Whilst this may be quite a manual process, next up will be to add a kind of source control setting between 2 branches and managing the .gitignore file to not submit the csproj file which contains the DLL naming toll.

Just wondering if it was the same process on yourside?

Currently, I just separated Zero Touch to a different Assembly, so zero touch and custom nodes are in the same solution. pkg.json only exist in the custom Node assembly.