private void channelConsumer_ChannelUpDownChanged(channelConsumer consumer, object value) { if (value is string) { this.ChannelUpDown = (string)value; } }
private async void channelWatcher_Added(channelWatcher watcher, AllJoynServiceInfo args) { if (_channelConsumer == null && args.ObjectPath.Contains(_expectedBusObjectPath)) { var joinSessionResult = await channelConsumer.JoinSessionAsync(args, watcher); if (joinSessionResult.Status == AllJoynStatus.Ok) { _channelConsumer = joinSessionResult.Consumer; _channelConsumer.SessionLost += this.Consumer_SessionLost; // subscribe to value changes _channelConsumer.ChannelUpDownChanged += this.channelConsumer_ChannelUpDownChanged; // populate initial values var channelUpDownResult = await _channelConsumer.GetChannelUpDownAsync(); if (channelUpDownResult.Status != AllJoynStatus.Ok) { return; } this.ChannelUpDown = channelUpDownResult.ChannelUpDown; this.IsConnected = true; } } }