How can I set property?

function treeon() {
myDiagram.toolManager.draggingTool.dragsTree = true;

$(go.TextBlock, “Tree On”),
{ click: function(e, obj) { treeon(); } }),

it can not work…

That looks OK to me, assuming there is some way for the user to turn off DraggingTool.dragsTree.

What do you want to do, and how is what you have tried not doing what you want?