void BusOperationStarting(BusOperationEventArgs e) { BusViewModel m = FindFirtOrDefault(e.Bus); if (m == null) { return; } m.Message = string.Format("正在{0}数据, Offset:{1}, Len:{2}......", e.Operation == BusOperation.Reading ? "读取" : "写入", e.Offset, e.Length); }
void bus_BusOperationStarting(object sender, BusOperationEventArgs e) { this.Dispatcher.Invoke(new Action(() => this.BusOperationStarting(e))); }
void bus_BusOperationCompleted(object sender, BusOperationEventArgs e) { this.Dispatcher.Invoke(new Action(() => this.BusOperationCompleted(e))); }