public MainWindow() { bool InDebugMode = false; String[] commArgs = Environment.GetCommandLineArgs(); InitializeComponent(); if (commArgs.Length > 1) { if (commArgs[1].Equals("-debug")) { InDebugMode = true; } } if (!InDebugMode) { DebugMode.Visibility = Visibility.Collapsed; } ProgramPresenter = new MVP_Presenter(this); // DispatcherTimer setup dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 5); ProgramPresenter.Resize(new Tuple <int, int>((int)LeftCanvas.Width, (int)LeftCanvas.Height), new Tuple <int, int>((int)RightCanvas.Width, (int)RightCanvas.Height)); //Setup overlay items SetupOverlay(); }
/********************************************/ /*** WINDOW SPECIFIC FUNCTIONS START HERE ***/ /********************************************/ /// <summary> /// Resize Function connected to the form resize event, will refresh the form when it is resized /// </summary> private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { ProgramPresenter.Resize(new Tuple <int, int>((int)LeftCanvas.ActualWidth, (int)LeftCanvas.ActualHeight), new Tuple <int, int>((int)RightCanvas.ActualWidth, (int)RightCanvas.ActualHeight)); }