internal PF2MoveHubFwUpdateDeviceViewModel(Hub hub, ILogger logger) { this.hub = hub ?? throw new ArgumentNullException(nameof(hub)); this.logger = logger; Name = hub.Name; // TODO: set a property to indicate error if InitAsync fails InitAsync().ContinueWith(t => { if (t.IsFaulted) { logger.LogDebug(t.Exception, "Unhandled exception in {0}", nameof(PF2MoveHubFwUpdateDeviceViewModel)); } }); }
private void Watcher_HubConnected(object sender, Hub hub) { invokeOnUIThread(() => { var match = Devices.SingleOrDefault(x => x.BDAddr == hub.Id); if (match == null) { Devices.Add(new PF2MoveHubFwUpdateDeviceViewModel(hub, null)); } else { match.Update(hub); } }); }
internal void Update(Hub hub) { this.hub = hub; }