示例#1
0
        private static void _arrangeLayers(LayerageCollection layerageCollection, Layerage parents, IList <Layerage> layers, int depth, Visibility visibility)
        {
            foreach (Layerage layerage in layers)
            {
                ILayer layer = layerage.Self;

                //Depth
                layer.Control.Depth = depth;
                //Parents
                layerage.Parents = parents;
                //IsExpand
                layer.Control.Self.Visibility = visibility;
                Visibility childVisibility = (layer.IsExpand && visibility == Visibility.Visible) ? Visibility.Visible : Visibility.Collapsed;
                //Children
                layer.Control.ChildrenCount = layerage.Children.Count;

                layerageCollection.RootControls.Add(layer.Control.Self);

                //Recursive
                LayerageCollection._arrangeLayers(layerageCollection, layerage, layerage.Children, depth + 1, childVisibility);
            }
        }
示例#2
0
 /// <summary>
 /// Arrange all layers's control, depth, parents and expand.
 /// </summary>
 /// <param name="layerageCollection"> The layerage-collection. </param>
 public static void ArrangeLayers(LayerageCollection layerageCollection)
 {
     layerageCollection.RootControls.Clear();
     LayerageCollection._arrangeLayers(layerageCollection, null, layerageCollection.RootLayerages, 0, Visibility.Visible);
 }