/*
        ControlPanelWatcher ControlPanelWatcher = null;
        private AllJoynBusAttachment controlPanelWatcherBusAttachment = new AllJoynBusAttachment();
        */

        public WeatherStationConsumer()
        {
            this.humidityWatcher = new HumidityWatcher(this.humidityBusAttachment);

            this.humidityWatcher.Added += HumidityWatcher_Added;
            this.humidityWatcher.Start();

            this.temperatureWatcher = new TemperatureWatcher(this.temperatureBusAttachment);
            this.temperatureWatcher.Added += TemperatureWatcher_Added;
            this.temperatureWatcher.Start();

            this.pressureWatcher = new PressureWatcher(this.pressureBusAttachment);
            this.pressureWatcher.Added += PressureWatcher_Added;
            this.pressureWatcher.Start();

        /*    this.ControlPanelWatcher = new ControlPanelWatcher(controlPanelWatcherBusAttachment);
            this.ControlPanelWatcher.Added += ControlPanelWatcher_Added;
            this.ControlPanelWatcher.Start();*/

        }
        private async void HumidityWatcher_Added(HumidityWatcher sender, AllJoynServiceInfo args)
        {

         HumidityJoinSessionResult joinResult = await HumidityConsumer.JoinSessionAsync(args, sender);
  //       AllJoynAboutDataView view = await AllJoynAboutDataView.GetDataBySessionPortAsync(args.UniqueName, this.humidityBusAttachment, args.SessionPort);
  //         var device = SensorClient.Factory.AllJoynDeviceFactory.GetAllJoynDevice(view);

            if (joinResult.Status == AllJoynStatus.Ok)
            {
                HumiditySensor newSensor = new HumiditySensor(joinResult.Consumer, args.UniqueName);

                var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
                await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => {
 //                   if (HumiditySensorSessionStarted != null)
                     //   HumiditySensorSessionStarted.Invoke(newSensor, device);
                });

            }
            else
            {
                throw new Exception(String.Format("Joining the session went wrong for HumiditySensor {0}", args.UniqueName));
            }
        }