Stoyo wrote on Sep 11
th, 2008 at 8:30am:
Hi,
Select the "when thrown" option for CLR exceptions in the Debug/Exceptions window. Now what is the value of the 'name' parameter when GetPropertyImpl throws that exception?
Using "when thrown", and switching to using WpfDiagram source code instead of prebuilt DLL, and loading the WPF public symbols, I was able to find what was making it unable to save (a certain property on our usercontrol), and work around it. Thanks!
Stoyo wrote on Sep 11
th, 2008 at 8:30am:
Are you resizing the nodes by setting DiagramNodeAdapter.Bounds, or by changing properties of the hosted controls? I suppose it's the latter; in such case, enable the DiagramNodeAdapter.AutoUpdateSize property. It specifies whether the nodes' Bounds value should update automatically to match the size of the hosted controls.
Currently, I'm setting both the Bounds of the DiagramNodeAdapter and the Height/Width of the UserControl, along with setting DiagramNodeAdapter.AutoUpdateSize to true. Besides the issue in my original post, this also makes it so resizing the node doesn't resize the usercontrol; the usercontrol is just centered in the resized node, staying the same size.
Ideally, I'd like the node to control the size of the UserControl, so that if the user wants to, they can resize it. In order to do that, it would make sense to me to set the Bounds of the DiagramNodeAdapter, leave AutoUpdateSize false, and set the UserControl to no Height/Width, and vertical/horizontal align of Stretch.
However, that doesn't work as expected. It works, except the content of the usercontrol doesn't get restricted to the size of the DiagramNodeAdapter. There's text in the UserControl, that's set to wrap (see "Sample Text" above). Unfortunately, it thinks it's got unlimited space to lay itself out, so doesn't wrap. For example, if the DiagramNodeAdapter is set to be 100x100, and the usercontrol contains text that's 150 wide, instead of the usercontrol being 100x100 with two lines of text, it ends up being 150x100 (clipped to just the leftmost 100x100), with one line of text. If I explicitly set its Width/Height, it wraps as expected. (EDIT: I've also tried this with AutoUpdateSize set to true; no change. I'm trying to get the size to update the other way from what AutoUpdateSize is intended to do, I think)
I'm guessing the DiagramNodeAdapter needs to tell the usercontrol its width/height as AvailableArea in its measure/layout calls? Or is there another way to do this that I'm missing?