public CommunicationsettingParamsDialog(CommunicationParams communicationParams) { InitializeComponent(); this.communicationParams = communicationParams; DataContext = this.communicationParams; EnsureButton.Click += EnsureButton_Click; CancelButton.Click += CancelButton_Click; KeyDown += CommunicationsettingParamsDialog_KeyDown; rangeTextbox.GetTextBox().Text = communicationParams.Timeout.ToString(); }
public CommunicationSettingDialog( CommunicationParams communicationParams, CommunicationSettingDialogMode mode = CommunicationSettingDialogMode.SETTING) { InitializeComponent(); this.communicationParams = communicationParams; Mode = mode; baseSetting.DataContext = this.communicationParams; EnsureButton.Click += EnsureButton_Click; CancelButton.Click += CancelButton_Click; CommunicationTestButton.Click += CommunicationTestButton_Click; KeyDown += CommunicationSettingDialog_KeyDown; if (Mode == CommunicationSettingDialogMode.DOWNLOAD) { baseSetting.DownloadDataGroupBox.Visibility = Visibility.Visible; } }