static void app_Startup(object sender, StartupEventArgs e) { double windowWidth = (int)(SystemParameters.MaximizedPrimaryScreenWidth / xNum) - sizeDiff; double windowHeight = (int)(SystemParameters.MaximizedPrimaryScreenHeight / yNum) - sizeDiff; for (int x = 0; x < xNum; x++) { for (int y = 0; y < yNum; y++) { PlotterWindow window = new PlotterWindow(); window.Title = String.Format("{0} - {1}", x, y); window.X = x; window.Y = y; window.Width = windowWidth; window.Height = windowHeight; window.WindowStartupLocation = WindowStartupLocation.Manual; window.WindowStyle = WindowStyle.None; //window.WindowState = WindowState.Maximized; //window.ShowInTaskbar = x + y == 0; window.Left = x * (windowWidth + 0); window.Top = y * (windowHeight + 0); window.Plotter.Viewport.Visible = ComputeVisible(x, y); window.VisibleChanged += new EventHandler(window_VisibleChanged); windows.Add(window); window.Show(); } } Application.Current.MainWindow = windows[0]; }
static void window_VisibleChanged(object sender, EventArgs e) { if (inChange) { return; } inChange = true; PlotterWindow window = (PlotterWindow)sender; DataRect vis = window.Plotter.Viewport.Visible; visible = ComputeVisibleNewVisible(vis, window.X, window.Y); var otherWindows = windows.Where(w => w != window); foreach (var win in otherWindows) { win.Plotter.Viewport.Visible = ComputeVisible(win.X, win.Y); } inChange = false; }