/// <summary> /// Initializes a new instance of the <see cref = "DisplayVisualizer" /> class. /// </summary> /// <param name = "viewModel"> /// The view model. /// </param> public DisplayVisualizer(VisualizerViewModel viewModel) { this.InitializeComponent(); this.visualizerView.DataContext = viewModel; this._viewModel = viewModel; var workingArea = Screen.PrimaryScreen.WorkingArea; var width = viewModel.DisplayWidth + 50; var height = viewModel.DisplayHeight + 65; this.Width = Math.Min(workingArea.Width, width == 0 ? 800 : width); this.Height = Math.Min(workingArea.Height, height == 0 ? 600 : height); }
public void Startup() #endif { if (this._channels.Any()) { this.LoadDataFromSetupNode(); var viewModel = new VisualizerViewModel(this._channels, this._elements, _background, _displayWidth, _displayHeight); this._displayVisualizer = new DisplayVisualizer(viewModel); this._displayVisualizer.Show(); } #if VIXEN_2_1 return new List<Form>(1) {_displayVisualizer}; #endif }