Ejemplo n.º 1
0
 public void ApplyLayout()
 {
     Surface.ApplyLayoutAlgorithm(new TreeLayoutAlgorithm
     {
         Info            = new FlowDiagramLayoutAlgorithmInfo(),
         LayoutDirection = LayoutDirection.TopToBottom,
     });
 }
        public void ApplyLayout()
        {
            if (!IsVisible)
            {
                return;
            }

            Dispatcher.BeginInvoke(new Action(() =>
            {
                Surface.ApplyLayoutAlgorithm(new TreeLayoutAlgorithm());
                Surface.SizeToFit();

                if (ds.Diagram.Nodes.Count <= 5)
                {
                    Surface.Zoom = 1;
                }
            }), DispatcherPriority.Loaded);
        }