diff --git a/HueUWP/App.xaml b/HueUWP/App.xaml
index da19261..74c682e 100644
--- a/HueUWP/App.xaml
+++ b/HueUWP/App.xaml
@@ -1,8 +1,8 @@
diff --git a/HueUWP/App.xaml.cs b/HueUWP/App.xaml.cs
index f465a11..68bc255 100644
--- a/HueUWP/App.xaml.cs
+++ b/HueUWP/App.xaml.cs
@@ -15,7 +15,7 @@ using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
-namespace HueUWP
+namespace BindingToCommandsUWP
{
///
/// Provides application-specific behavior to supplement the default Application class.
@@ -43,7 +43,7 @@ namespace HueUWP
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
- this.DebugSettings.EnableFrameRateCounter = true;
+ this.DebugSettings.EnableFrameRateCounter = false;
}
#endif
diff --git a/HueUWP/HueUWP.csproj b/HueUWP/HueUWP.csproj
index d7e0ef6..4ce3100 100644
--- a/HueUWP/HueUWP.csproj
+++ b/HueUWP/HueUWP.csproj
@@ -96,6 +96,7 @@
App.xaml
+
MainPage.xaml
diff --git a/HueUWP/HueUWP.sln b/HueUWP/HueUWP.sln
new file mode 100644
index 0000000..6e5e026
--- /dev/null
+++ b/HueUWP/HueUWP.sln
@@ -0,0 +1,40 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HueUWP", "HueUWP.csproj", "{88414ECD-0462-41DE-ABA9-462D2F154595}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|ARM.ActiveCfg = Debug|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|ARM.Build.0 = Debug|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|ARM.Deploy.0 = Debug|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x64.ActiveCfg = Debug|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x64.Build.0 = Debug|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x64.Deploy.0 = Debug|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x86.ActiveCfg = Debug|x86
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x86.Build.0 = Debug|x86
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Debug|x86.Deploy.0 = Debug|x86
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|ARM.ActiveCfg = Release|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|ARM.Build.0 = Release|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|ARM.Deploy.0 = Release|ARM
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x64.ActiveCfg = Release|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x64.Build.0 = Release|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x64.Deploy.0 = Release|x64
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x86.ActiveCfg = Release|x86
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x86.Build.0 = Release|x86
+ {88414ECD-0462-41DE-ABA9-462D2F154595}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/HueUWP/Light.cs b/HueUWP/Light.cs
new file mode 100644
index 0000000..69436ff
--- /dev/null
+++ b/HueUWP/Light.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace BindingToCommandsUWP
+{
+ public class Light : INotifyPropertyChanged
+ {
+ public int ID { get; set; }
+ public string Make { get; set; }
+ public string Model { get; set; }
+
+ private string checkedInDateTime;
+
+ public string CheckedInDateTime
+ {
+ get { return checkedInDateTime; }
+ set
+ {
+ checkedInDateTime = value;
+ NotifyPropertyChanged(nameof(CheckedInDateTime));
+ }
+ }
+
+
+
+ public Light()
+ {
+
+ }
+
+ public void CheckInCar()
+ {
+ this.CheckedInDateTime = String.Format("{0:t}", DateTime.Now);
+ }
+
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private void NotifyPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ }
+
+ public class LightDataSource
+ {
+ private static ObservableCollection _cars
+ = new ObservableCollection();
+
+ public static ObservableCollection GetCars()
+ {
+ if (_cars.Count == 0)
+ {
+ _cars.Add(new Light() { ID = 1, Make = "Tesla", Model = "Model S" });
+ _cars.Add(new Light() { ID = 2, Make = "Tesla", Model = "Model 3" });
+ _cars.Add(new Light() { ID = 3, Make = "Tesla", Model = "Model X" });
+ }
+ return _cars;
+ }
+
+ //public static void CheckInCar(Car car)
+ //{
+ // _cars.FirstOrDefault(p => p.ID == car.ID).CheckedInDateTime = String.Format("{0:t}", DateTime.Now);
+ //}
+ }
+
+
+
+
+}
diff --git a/HueUWP/MainPage.xaml b/HueUWP/MainPage.xaml
index 538d50b..4d9e4d8 100644
--- a/HueUWP/MainPage.xaml
+++ b/HueUWP/MainPage.xaml
@@ -1,13 +1,41 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/HueUWP/MainPage.xaml.cs b/HueUWP/MainPage.xaml.cs
index bbf5d22..48b4cda 100644
--- a/HueUWP/MainPage.xaml.cs
+++ b/HueUWP/MainPage.xaml.cs
@@ -1,34 +1,54 @@
-using System;
-using System.Collections.Generic;
+using HueUWP;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
-
-namespace HueUWP
-{
- ///
- /// An empty page that can be used on its own or navigated to within a Frame.
- ///
- public sealed partial class MainPage : Page
- {
- public MainPage()
- {
- this.InitializeComponent();
- Debug.WriteLine(new NetworkHandler().RegisterName("Kaas", "Henk"));
- Debug.WriteLine(new NetworkHandler().Test());
-
- }
- }
-}
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
+
+namespace BindingToCommandsUWP
+{
+
+
+
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainPage : Page
+ {
+ private ObservableCollection _carsViewModel = LightDataSource.GetCars();
+
+ public ObservableCollection CarsViewModel
+ {
+ get { return this._carsViewModel; }
+ }
+
+ public MainPage()
+ {
+ this.InitializeComponent();
+ Debug.WriteLine(new NetworkHandler().RegisterName("Kaas", "Henk"));
+ Debug.WriteLine(new NetworkHandler().Test());
+ }
+
+ private void CheckInButton_Click(object sender, RoutedEventArgs e)
+ {
+ Button button = ((Button)sender);
+ Light light = (Light)button.DataContext;
+
+ light.CheckInCar();
+ }
+
+ }
+}
diff --git a/HueUWP/Package.appxmanifest b/HueUWP/Package.appxmanifest
index ec2d358..d3e1aaa 100644
--- a/HueUWP/Package.appxmanifest
+++ b/HueUWP/Package.appxmanifest
@@ -7,15 +7,15 @@
IgnorableNamespaces="uap mp">
-
+
- HueUWP
- kenny
+ CarCheckInUWP
+ Paul de Mast
Assets\StoreLogo.png
@@ -30,12 +30,12 @@
+ EntryPoint="CarCheckInUWP.App">