private void LampList_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { int i = 0; i++; if (LampList.SelectedItem != null) { ViewModels.AJViewBulb ajb = (ViewModels.AJViewBulb)LampList.SelectedItem; } }
private async void updateBulbDisplay(DisplayLamp b) { var dispatcher = Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher; await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async() => { var vm = this.DataContext as ViewModels.MainPageViewModel; ViewModels.AJViewBulb ajb = vm.Update(b.about.DeviceId, b.about.DeviceName); if (ajb != null) { ajb.Brightness = (byte)DisplayLamp.hexToPercent(b.Brightness.Brightness); ajb.UintBrush = b.Hue.Hue; ajb.Saturation = (uint)DisplayLamp.hexToPercent(b.Saturation.Saturation); ajb.ColorTemperature = b.ColorTemp.ColorTemp; ajb.IsBulbOn = b.OnOff.OnOff; } }); }