private void _tb_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (TryParse(SelectedType, _tb.Text)) { Conditions = new Tuple <Type, string>(SelectedType, _tb.Text); ConditionsChanged?.Invoke(Conditions.Item1, Conditions.Item2); } } }
public void Start() { for (int i = 0; i < 3; i++) { Thread.Sleep(dice.Next(1, 6) * 1000); temperature = dice.NextDouble() * 50; pressure = dice.NextDouble() * 50; humidity = dice.NextDouble() * 50; Console.WriteLine($"T: {temperature}, P: {pressure}, H: {humidity}"); ConditionsChanged?.Invoke(temperature, pressure, humidity); //update(temperature, pressure, humidity); } }
private void OnClearClick(object sender, RoutedEventArgs e) { Conditions = null; ConditionsChanged?.Invoke(null, null); }
protected virtual void OnConditionsChanged(object sender, ConditionsChangedEventArgs ea) { ConditionsChanged?.Invoke(sender, ea); }