Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TreeLayout Diagram - TopDown Alignment Problem (Read 2397 times)
john.ph.ho
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 9th, 2011
TreeLayout Diagram - TopDown Alignment Problem
Mar 9th, 2011 at 6:33pm
Print Post  
I created a Diagram with a TopDown Tree Layout inside a scrollviewer to allow panning and scrolling  with control nodes but I have a problem of the far left most node is always stretched far to the left and not the same node distance as the rest.  My ultimate goal is to create a topdown treelayout diagram that is centered with the ability to resize when a node is dragged out of the bounds.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout Diagram - TopDown Alignment Problem
Reply #1 - Mar 9th, 2011 at 7:11pm
Print Post  
Could you email the diagram xml file to support@mindfusion.eu?
  
Back to top
 
IP Logged
 
john.ph.ho
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 9th, 2011
Re: TreeLayout Diagram - TopDown Alignment Problem
Reply #2 - Mar 25th, 2011 at 8:31pm
Print Post  
I tried to use

var xDocument = new XDocument();EntityDiagram.SaveToXml(xDocument);


But it threw an exception.

{System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at MindFusion.Diagramming.Silverlight.XmlPersistContext.x8b38a32e275b6eed(DiagramIt
em xccb63ca5f63dc470, XElement xfbf34718e704c6bc, String xf3b84994b646e986)
   at MindFusion.Diagramming.Silverlight.XmlPersistContext.xcfee0917c3bf82cc(DiagramIt
em xccb63ca5f63dc470, XElement x1ea18269223b2a9c, String x121383aa64985888)
   at MindFusion.Diagramming.Silverlight.Diagram.SaveToXml(XDocument document)
   at iEvolve.EMS.Views.Pages.Families.EntityDiagramView.BuildEntityDiagram()
   at iEvolve.EMS.Views.Pages.Families.EntityDiagramView.<OnNavigatedTo>b__1(Object propertyChangedSender, PropertyChangedEventArgs propertyChangedEventArgs)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at iEvolve.EMS.ViewModels.ViewModelBase.OnPropertyChanged(String propertyName)
   at iEvolve.EMS.ViewModels.Pages.Families.EntityDiagramViewModel.set_EntityLinksLoad
ed(Boolean value)
   at iEvolve.EMS.ViewModels.Pages.Families.EntityDiagramViewModel.<GetEntityLinksList
>b__16(Object familyLinksQuerySender, EventArgs familyLinksQueryEventArgs)
   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Object result)
   at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(DomainClientRes
ult result)
   at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResul
t asyncResult)
   at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass1b.<Loa
d>b__17(Object )}




Here a some of my Xaml and Code:

Xaml:

<ScrollViewer
                           x:Name="DiagramScrollViewer"
                           Margin="0"
                           Padding="0"
                           BorderBrush="{x:Null}"
                           BorderThickness="0"
                           HorizontalScrollBarVisibility="Visible"
                           VerticalScrollBarVisibility="Visible">
                           <MindFusion_Diagramming_Silverlight:Diagram
                               x:Name="EntityDiagram"
                               MouseLeftButtonDown="EntityDiagram_MouseLeftButtonDown"
                               Background="#66FFFFFF"
                               Width="Auto"
                               Height="Auto"                               
                               LinkCrossings="Arcs"
                               RoundedLinks="True"
                               AutoScroll="True"
                               DynamicLinks="True"
                               AlignToGrid="True" />
                       </ScrollViewer>


--- Code

EntityDiagram.Behavior = Behavior.Custom;
EntityDiagram.AutoResize = utoResize.AllDirections;

var layout = new TreeLayout
                            {
                                Direction = TreeLayoutDirections.TopToBottom,
                                KeepRootPosition = true,
                                IgnoreLinkDirection = true,
                                Root = RootDiagramNode,
LevelDistance = 65,
NodeDistance = 65,
EnableAssistants = true,
//layout.StretchFactor = 0.05,
CompactAssistants = true
                            };
       layout.Arrange(EntityDiagram);
       EntityDiagram.ResizeToFitItems(50);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout Diagram - TopDown Alignment Problem
Reply #3 - Mar 26th, 2011 at 11:26am
Print Post  
If you are using custom node types, call the Diagram.RegisterItemClass method to enable XML serialization for them.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint