From 907e4a2a361713469ea457ea8fe1f1df51be57b9 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Mon, 7 Dec 2015 10:43:55 +0100 Subject: [PATCH] Improved multi-edit interface --- HueUWP/MainPage.xaml | 44 ++++++++++++++++++++++++++++++++++------ HueUWP/MainPage.xaml.cs | 15 +++++++++++++- HueUWP/MultiEdit.xaml | 2 +- HueUWP/MultiEdit.xaml.cs | 7 ++++++- 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/HueUWP/MainPage.xaml b/HueUWP/MainPage.xaml index abcdae4..d5d3bf4 100644 --- a/HueUWP/MainPage.xaml +++ b/HueUWP/MainPage.xaml @@ -61,14 +61,46 @@ - - + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/HueUWP/MainPage.xaml.cs b/HueUWP/MainPage.xaml.cs index c8cb178..cfd5ac5 100644 --- a/HueUWP/MainPage.xaml.cs +++ b/HueUWP/MainPage.xaml.cs @@ -161,11 +161,24 @@ namespace HueUWP private void OnOffButton_Click(object sender, RoutedEventArgs e) { + bool first = false; + + if(OnOffButton.Label == "Off") + { + first = false; + OnOffButton.Label = "On"; + } + else + { + first = true; + OnOffButton.Label = "Off"; + } + if ((bool)GroupButton.IsChecked) { foreach(var v in myListView.SelectedItems) { - ((Light)v).UpdateState(!((Light)v).IsOn); + ((Light)v).UpdateState(first); } } } diff --git a/HueUWP/MultiEdit.xaml b/HueUWP/MultiEdit.xaml index 2af6ad1..d10e3b7 100755 --- a/HueUWP/MultiEdit.xaml +++ b/HueUWP/MultiEdit.xaml @@ -34,7 +34,7 @@ - + Off On diff --git a/HueUWP/MultiEdit.xaml.cs b/HueUWP/MultiEdit.xaml.cs index f1081e1..9979401 100755 --- a/HueUWP/MultiEdit.xaml.cs +++ b/HueUWP/MultiEdit.xaml.cs @@ -36,7 +36,12 @@ namespace HueUWP { main = e.Parameter as MainPage; - foreach(var v in main.GetListView().SelectedItems) + HueSlider.Value = ((Light) main.GetListView().SelectedItems[0]).Hue; + SaturationSlider.Value = ((Light)main.GetListView().SelectedItems[0]).Saturation; + BrightnessSlider.Value = ((Light)main.GetListView().SelectedItems[0]).Brightness; + OnOffButton.IsOn = ((Light)main.GetListView().SelectedItems[0]).IsOn; + + foreach (var v in main.GetListView().SelectedItems) { Light l = (Light)v; lights.Add(l);