23 lines
664 B
C#
23 lines
664 B
C#
using System;
|
|
using System.Windows;
|
|
|
|
namespace Mqtt_SWB_Dashboard {
|
|
/// <summary>
|
|
/// Interaktionslogik für MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window {
|
|
public MainWindow() {
|
|
InitializeComponent();
|
|
Stats s = new Stats(new Mosquitto());
|
|
s.UpdatedConsumption += this.S_UpdatedConsumption;
|
|
}
|
|
|
|
private void S_UpdatedConsumption(Stats sender, EventArgs e) {
|
|
this.Dispatcher.BeginInvoke((Action)(() => {
|
|
this.countHouses.Text = sender.GetNumberHouseholds().ToString();
|
|
this.countDevices.Text = sender.GetNumberDevices().ToString();
|
|
}));
|
|
}
|
|
}
|
|
}
|