Exemplo n.º 1
0
        public UiMainWindow()
        {
            #region Construct

            Assembly        assembly = Assembly.GetEntryAssembly();
            FileVersionInfo fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            Title = $"{fvi.ProductName} {fvi.FileVersion} {fvi.LegalCopyright}";

            Width  = 640;
            Height = 480;
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            WindowState           = WindowState.Maximized;

            UiGrid root = UiGridFactory.Create(2, 1);
            root.RowDefinitions[0].Height = GridLength.Auto;

            DockingManager dockingManager = new DockingManager();
            {
                root.AddUiElement(dockingManager, 1, 0);
                _layoutSerializer = new XmlLayoutSerializer(dockingManager);
                _layoutSerializer.LayoutSerializationCallback += OnLayoutDeserialized;
            }

            _mainMenu = UiMenuFactory.Create();
            {
                _mainMenuView = _mainMenu.AddChild(UiMenuItemFactory.Create("Вид"));
                {
                    foreach (UiMainDockableControl dockable in UiMainDockableControl.CreateKnownDockables(dockingManager))
                    {
                        _mainMenuView.AddChild(dockable.CreateMenuItem());
                    }
                }

                root.AddUiElement(_mainMenu, 0, 0);
            }

            Content = root;

            #endregion

            Loaded  += OnLoaded;
            Closing += OnClosing;
        }
Exemplo n.º 2
0
        public UiMainWindow()
        {
            #region Construct

            Assembly assembly = Assembly.GetEntryAssembly();
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            Title = String.Format("{0} {1} {2}", fvi.ProductName, fvi.FileVersion, fvi.LegalCopyright);

            Width = 640;
            Height = 480;
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            WindowState = WindowState.Maximized;

            UiGrid root = UiGridFactory.Create(2, 1);
            root.RowDefinitions[0].Height = GridLength.Auto;

            DockingManager dockingManager = new DockingManager();
            {
                root.AddUiElement(dockingManager, 1, 0);
                _layoutSerializer = new XmlLayoutSerializer(dockingManager);
                _layoutSerializer.LayoutSerializationCallback += OnLayoutDeserialized;
            }

            _mainMenu = UiMenuFactory.Create();
            {
                _mainMenuView = _mainMenu.AddChild(UiMenuItemFactory.Create("Вид"));
                {
                    foreach (UiMainDockableControl dockable in UiMainDockableControl.CreateKnownDockables(dockingManager))
                        _mainMenuView.AddChild(dockable.CreateMenuItem());
                }

                root.AddUiElement(_mainMenu, 0, 0);
            }

            Content = root;

            #endregion

            Loaded += OnLoaded;
            Closing += OnClosing;
        }