Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing AnchorPoints (Visibility, etc.) (Read 4081 times)
JasonB
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Changing AnchorPoints (Visibility, etc.)
Jun 9th, 2008 at 10:21pm
Print Post  
Seems like if I set a new anchor pattern on a node, it just overlays the pattern on the existing one, rather than replacing it? My nodes expand / collapse (it's  a treeview) so I need to be adding/removing anchor points. I tried setting visibility to collapsed and hidden and that also had no affect. Also tried changing MarkStyle to None. Is there a way to hide anchor points that I missed?

Also, manually resizing a node does not move the anchor points? Isn't that a bit odd, since the locations are given as percentages of the total width and height? Is that a bug?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing AnchorPoints (Visibility, etc.)
Reply #1 - Jun 10th, 2008 at 6:05am
Print Post  
The anchor points overlaying looks like a bug, where the visuals for the old AnchorPattern are not removed from the WPF visual tree. We'll post a fixed version today. The resizing problem seems to be the same bug - the newly assigned anchor points are moved correctly, but the old ones are not associated with the node anymore and are not processed when the node is resized.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing AnchorPoints (Visibility, etc.)
Reply #2 - Jun 10th, 2008 at 8:56am
Print Post  
This version should fix the anchor layering problem:
https://www.mindfusion.eu/_beta/wpfdiag101pre.zip

Stoyan
  
Back to top
 
IP Logged
 
JasonB
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Re: Changing AnchorPoints (Visibility, etc.)
Reply #3 - Jun 10th, 2008 at 3:08pm
Print Post  
Thanks.

FYI, This does fix the anchor points issue, but now when my node is first placed it is extremely tiny (seems like it isn't respecting the bounds I set for it).

The workaround for this is to call UIElement.Measure() before adding the element to the diagram (via the Nodes collection).

Also if my nodes expand, the diagram does not enlarge (it's contained in a scrollviewer and the bars do not show up). Calling ResizeToFitItems() fixes this, but generally in WPF the parent container automatically takes care of this. For example, a normal treeview will add scrollbars automatically when the treeview items are expanded if they are too large for the container. The treeview template is merely an itemspresenter inside of a scrollviewer, so it seems like this behavior is automatically provided by the WPF layout system. It seems like WPF Diagram does not properly participate in this system? This seems like the reason why I need to resize the node when its content expands -  unless I am wrong, I believe this shouldn't be necessary.

Thanks again for all your help.
  
Back to top
 
IP Logged
 
JasonB
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Re: Changing AnchorPoints (Visibility, etc.)
Reply #4 - Jun 10th, 2008 at 3:20pm
Print Post  
Also, anchor points still don't respect UIElement.Visibility property.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing AnchorPoints (Visibility, etc.)
Reply #5 - Jun 11th, 2008 at 9:20am
Print Post  
In that latest version the Diagram calls Arrange(availableSize) on a UIElement when one is added, so it corresponds to the DiagramNode.Bounds.Size, which was needed for tooltips to work correctly. I suppose we should do the opposite when adding UIElements not derived from DiagramNode, and update the adapter's Bounds from the element's DesiredSize. We'll also add an auto-update property to DiagramNodeAdapter, so that the adapter nodes update their and the diagram's Bounds when the hosted UIElement requests a ne size.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint