void BusStateChanged(BusStateChangedEventArgs e) { BusViewModel m = FindFirtOrDefault(e.Bus); if (m == null) { return; } m.State = e.CurrentState; }
void bus_BusStateChanged(object sender, BusStateChangedEventArgs e) { this.Dispatcher.Invoke(new Action(() => this.BusStateChanged(e))); }