Ejemplo n.º 1
0
        public void ShowWindow(Type type)
        {
            // 查找到layout中是否存在
            var layout = dockManager.Layout.Descendents().OfType<LayoutAnchorable>().FirstOrDefault(X => X.Content != null && X.Content.GetType().Equals(type));
            if (layout == null)
            {
                var window = TypeService.CreateInstance(type) as Control;

                layout = new LayoutAnchorable();
                layout.Content  = window;
                layout.Title    = window.Tag.ToString();

                layout.AddToLayout(dockManager, AnchorableShowStrategy.Left);
            }

            // 将layout添加到root中
            layout.Float();
        }