/// <summary> /// The constructor. /// Gets it's components. /// </summary> /// <param name="controllersPanelVM"></param> /// <param name="connectionPanelVM"></param> /// <param name="errorsPanelVM"></param> public UserMainPanel(IControllersPanelVM controllersPanelVM, IConnectionPanelVM connectionPanelVM, IErrorsPanelMessager errorsPanelVM) { InitializeComponent(); // Add the controllers panel. ControllersPanel controllersp = new ControllersPanel(controllersPanelVM); controllersp.MouseUpOccurredReleaseJoystick += delegate(object sender, MouseButtonEventArgs e) { this.HandleJoystickMouseUp(sender, e); }; this.RegisterName("controllersPanel", controllersp); mainUserPanel.Children.Add(controllersp); Grid.SetRow(controllersp, 0); // Add the connections panel. ConnectionPanel connectionp = new ConnectionPanel(connectionPanelVM); connectionp.MouseUpOccurredReleaseJoystick += delegate(object sender, MouseButtonEventArgs e) { this.HandleJoystickMouseUp(sender, e); }; mainUserPanel.Children.Add(connectionp); Grid.SetRow(connectionp, 1); // Add the errors panel. ErrorsPanel errorsPanel = new ErrorsPanel(errorsPanelVM); mainUserPanel.Children.Add(errorsPanel); Grid.SetRow(errorsPanel, 2); }
private void OkButton_Click(object sender, EventArgs e) { SelectedDevices = ControllersPanel.GetSelected(); DialogResult = DialogResult.OK; }