Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Dynamically created Diagram does not have scroll (Read 1666 times)
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Dynamically created Diagram does not have scroll
May 7th, 2010 at 2:15pm
Print Post  
Dynamically created Diagram does not have scrollbars.
I have these settings in the XAML for a Diagram and the scrollbars show correctly.. however if i create a diagram dynamicvally in code i dont see any scroll bars. code's below what am I missing?

<Silverlight:Diagram Margin="1"
                                                       Height="2880"
                                                       Width="5120"
                                                   HorizontalAlignment="Left"
                                                   VerticalAlignment="Top"
                                                   BorderBrush="Gray"
                                                   BorderThickness="5"
                                                   GridOffsetX="0"
                                                   GridOffsetY="0"
                                                   LinkBrush="Black"   
                                                   AllowInplaceEdit="false"
                                                   ShapeBrush="white"
                                                   Bounds="0,0,2000,3000"
                                                   Behavior="DrawLinks"   
                                                   x:Name="diagram"
                                                   LinkDoubleClicked="diagram_LinkDoubleClicked"
                                                   LinkCreating="diagram_LinkCreating"
                                                   LinkCreated="diagram_LinkCreated"
                                                   LinkDeleted="diagram_LinkDeleted"
                                                   LinkSelected="diagram_LinkSelected"
                                                   LinkModified="diagram_LinkModified"
                                                    UndoEnabled="True"    
                                                   NodeDoubleClicked="diagram_NodeDoubleClicked"
                                                   NodeClicked="diagram_NodeClicked"
                                                   NodeModifying="diagram_NodeModifying"
                                                   NodeModified="diagram_NodeModified"
                                                   NodeSelected="diagram_NodeSelected"
                                                  
                                                   KeyDown="diagram_KeyDown"
                                                   KeyUp="diagram_KeyUp"
                                                   MouseLeftButtonUp="diagram_MouseLeftButtonUp"
                                                  
                                                   >


----- C# Code creatign diagram dynamically--------

private static void SetDiagramProperties(Diagram subFlowdiagram, TaskNodeTag tag, UserMapPreferences prefs)
       {
           subFlowdiagram.HorizontalAlignment = HorizontalAlignment.Left;
           subFlowdiagram.VerticalAlignment = VerticalAlignment.Top;
         
           subFlowdiagram.BorderBrush = Brushes.Gray;
           subFlowdiagram.BorderThickness = new Thickness(5);
           subFlowdiagram.LinkBrush = Brushes.Black;
           SetGridStyle(subFlowdiagram, prefs);
           subFlowdiagram.GridOffsetX = 0;
           subFlowdiagram.GridOffsetY = 0;
           
           subFlowdiagram.GridSizeX = prefs.HorizontalGridSpacing;
           subFlowdiagram.GridSizeY = prefs.VerticalGridSpacing;
           
           
           
           subFlowdiagram.Behavior = Behavior.DrawLinks;
           subFlowdiagram.AlignToGrid = prefs.SnapToGrid;
           subFlowdiagram.Behavior = Behavior.LinkShapes;
           subFlowdiagram.AllowInplaceEdit = false;
           subFlowdiagram.ShapeBrush = Brushes.White;
           subFlowdiagram.Name = "S-" + tag.Task.Id;
           subFlowdiagram.Height = 2880;
           subFlowdiagram.Width = 5120;
           subFlowdiagram.Bounds = new Rect(0, 0, 2000, 3000);
         


       }
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamically created Diagram does not have scro
Reply #1 - May 7th, 2010 at 3:32pm
Print Post  
Have you added that subFlowdiagram to a ScrollViewer?
  
Back to top
 
IP Logged
 
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Re: Dynamically created Diagram does not have scro
Reply #2 - May 7th, 2010 at 3:37pm
Print Post  
No. can you please share with me how do i do this in code.. appriciate it. thanks Don
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dynamically created Diagram does not have scro
Reply #3 - May 7th, 2010 at 3:59pm
Print Post  
Instead of adding the diagram to its current panel, add a ScrollViewer there, and set scrollViewer.Content = subFlowdiagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint