private void SetBedIdTextBox(UserControl1 name, int count) { if (name.FindName("BedIdTextBox") is TextBox bedIdTextBox) { bedIdTextBox.Text = count.ToString(); } }
private void DisableStartMonitorButton(UserControl1 name) { if (name.FindName("StartMonitorButton") is Button startButton) { startButton.Visibility = System.Windows.Visibility.Collapsed; } }
private string GetPatientIdDetails(UserControl1 name) { string returnValue = ""; if (name.FindName("PatientIdTextBox1") is TextBox patientIdTextBox) { returnValue = patientIdTextBox.Text; } return(returnValue); }
private void InvokeStartMonitor(UserControl1 name) { if (GetPatientIdDetails(name) == "") { if (name.FindName("StartMonitorButton") is Button startButton) { ButtonAutomationPeer peer = new ButtonAutomationPeer(startButton); IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; invokeProv?.Invoke(); } } }
public MainWindow() { if (Properties.Settings.Default.shrani == true) { dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(hr, min, sec); dispatcherTimer.Start(); } InitializeComponent(); UserControl1 uc = usr; var text = uc.FindName("txtEditor") as RichTextBox; struktura = uc.FindName("strukturaProjekta") as TreeView; uc.OnMethodSelect += (senser, e) => { PassThrough("MethodChange", senser, e); }; uc.OnFileSelect += (senser, e) => { PassThrough("FileChange", senser, e); }; }