Resetting the visual offset of an usercontrol WPF

633 Views Asked by At

There is treeview whose nodes are bound to usercontrols which are loaded using view injection on selection. At this point the visual offset for the control is set to (0,0). Is there a way I can alter this visual offset later. O How can I unload this control from visual tree when it is deselected so that this visual offset is set to default.

1

There are 1 best solutions below

0
On BEST ANSWER

I ended up recreating the usercontrol everytime I want to change the visual offset.