protected override void OnStartup(StartupEventArgs e)
        {
#if DEBUG
            DisplayGeometryGraph.SetShowFunctions();
#endif

            // debug
            //Test1.RunTest9();

            _appWindow = new AppWindow
            {
                Title       = "Graphmaps browser",
                Width       = SystemParameters.WorkArea.Width - 300,
                Height      = SystemParameters.WorkArea.Height,
                GraphViewer = _graphViewer,
                //Content = dockPanel,
                //WindowStartupLocation = WindowStartupLocation.CenterScreen,
                //WindowState = WindowState.Normal
            };

            _dockPanel        = _appWindow.GetMainDockPanel();
            _graphViewerPanel = _appWindow.GetGraphViewerPanel();
            _statusTextBox    = _appWindow.GetStatusTextBox();

            //SetupToolbar();
            SetAppCommands();

            //graphViewerPanel.ClipToBounds = true;
            //dockPanel.Children.Add(toolBar);
            //SetUpStatusBar();

            //dockPanel.LastChildFill = true;
            //dockPanel.Children.Add(graphViewerPanel);
            _graphViewer.BindToPanel(_graphViewerPanel);
            _dockPanel.Loaded += GraphViewerLoaded;
            _argsParser        = SetArgsParser(Args);
            //graphViewer.MainPanel.MouseLeftButtonUp += TestApi;
            TrySettingGraphViewerLargeLayoutThresholdAndSomeOtherLgSettings();
            if (_argsParser.OptionIsUsed(ExitAfterLgLayoutOption))
            {
                _graphViewer.DefaultLargeLayoutSettings.ExitAfterInit = true;
            }

            _graphViewer.ViewChangeEvent += GraphViewerViewChangeEvent;
            _graphViewer.ObjectUnderMouseCursorChanged += GvObjectUnderMouseCursorChanged;
            _graphViewer.MouseDown += GraphViewerMouseDown;
            _graphViewer.MouseMove += GraphViewerMouseMove;


            _graphViewer.GraphChanged += graphViewer_GraphChanged;
            //graphViewer.LayoutEditingEnabled = false;
            OnStartupTextBox(e);
            base.OnStartup(e);
            _appWindow.Show();
//SetUpAndShowSideWindow();
        }
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e) {
#if DEBUG
            DisplayGeometryGraph.SetShowFunctions();
#endif

            // debug
            //Test1.RunTest9();

            _appWindow = new AppWindow
            {
                Title = "Graphmaps browser",
                Width = SystemParameters.WorkArea.Width - 300,
                Height = SystemParameters.WorkArea.Height,
                GraphViewer=_graphViewer,
                //Content = dockPanel,
                //WindowStartupLocation = WindowStartupLocation.CenterScreen,
                //WindowState = WindowState.Normal
            };

            _dockPanel = _appWindow.GetMainDockPanel();
            _graphViewerPanel = _appWindow.GetGraphViewerPanel();
            _statusTextBox = _appWindow.GetStatusTextBox();

            //SetupToolbar();
            SetAppCommands();

            //graphViewerPanel.ClipToBounds = true;
            //dockPanel.Children.Add(toolBar);
            //SetUpStatusBar();

            //dockPanel.LastChildFill = true;
            //dockPanel.Children.Add(graphViewerPanel);
            _graphViewer.BindToPanel(_graphViewerPanel);
            _dockPanel.Loaded += GraphViewerLoaded;
            _argsParser = SetArgsParser(Args);

            if (_argsParser.OptionIsUsed(BackgroundColorOption)) {
                var bc = _argsParser.GetValueOfOptionWithAfterString(BackgroundColorOption);
                _graphViewerPanel.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom(bc));
            }

            //graphViewer.MainPanel.MouseLeftButtonUp += TestApi;
            TrySettingGraphViewerLargeLayoutThresholdAndSomeOtherLgSettings();
            if (_argsParser.OptionIsUsed(ExitAfterLgLayoutOption)) {
                _graphViewer.DefaultLargeLayoutSettings.ExitAfterInit = true;
            }

            _graphViewer.ViewChangeEvent += GraphViewerViewChangeEvent;
            _graphViewer.ObjectUnderMouseCursorChanged += GvObjectUnderMouseCursorChanged;
            _graphViewer.MouseDown += GraphViewerMouseDown;
            _graphViewer.MouseMove += GraphViewerMouseMove;


            _graphViewer.GraphChanged += graphViewer_GraphChanged;
            //graphViewer.LayoutEditingEnabled = false;
            OnStartupTextBox(e);
            base.OnStartup(e);
            _appWindow.Show();
//SetUpAndShowSideWindow();
        }