Esempio n. 1
0
        private void AddOrShowView(ISubView view, bool show)
        {
            subviewmap[view.ContentID] = view;
            string           viewname = view.ContentID;
            LayoutContent    targetContent;
            LayoutAnchorable targetView;

            viewList.TryGetValue(viewname, out targetContent);
            targetView = targetContent as LayoutAnchorable;
            if (targetView == null)
            {
                targetView = new LayoutAnchorable();
                viewList.Add(viewname, targetView);
                targetView.AddToLayout(DockMan, AnchorableShowStrategy.Most);
                targetView.DockAsDocument();
                targetView.CanClose = false;
                targetView.Hide();
            }
            if (targetView.Content == null)
            {
                targetView.Content     = view.View;
                targetView.ContentId   = viewname;
                targetView.Title       = view.GetTitle(ResourceService.CurrentCulture);
                targetView.CanAutoHide = true;
            }
            if (show)
            {
                targetView.IsVisible = true;
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            SaveCommandBinding.Command = SaveCommand;
            SaveMenuItem.Command       = SaveCommand;

            SaveLayoutCommandBinding.Command = SaveLayoutCommand;
            SaveLayoutMenuItem.Command       = SaveLayoutCommand;

            ReloadLayoutCommandBinding.Command = ReloadLayoutCommand;
            ReloadLayoutMenuItem.Command       = ReloadLayoutCommand;

            _layoutService = new LayoutService();

            CheckMenuItems();

            var anchorable = new LayoutAnchorable
            {
                Content     = new ConnectionOverview(DisplayConnection),
                Title       = Properties.Resources.Connections,
                ContentId   = "ConnectionsId",
                IsActive    = true,
                IsSelected  = true,
                CanFloat    = true,
                CanAutoHide = true,
                CanClose    = false,
                CanHide     = false
            };

            anchorable.AddToLayout(DockingManager, AnchorableShowStrategy.Left);

            anchorable.DockAsDocument();


            OpenConnectionWithAutoOpen();
        }