public NanoLeafControl(INanoLeafClient nanoLeafClient) { InitializeComponent(); _nanoLeafClient = nanoLeafClient; int count = 0; foreach (var element in NanoLeafSettings.NanoLeafDevices) { var newbuttonOff = new NanoLeafButton { Text = element.Name + " On", Command = true, Device = element }; newbuttonOff.Clicked += HandlerButtonClicked; GridNanoLeaf.Children.Add(newbuttonOff, count, 1); var newbuttonOn = new NanoLeafButton { Text = element.Name + " Off", Command = false, Device = element }; newbuttonOn.Clicked += HandlerButtonClicked; GridNanoLeaf.Children.Add(newbuttonOn, count, 2); count++; } }
public HomeComingPageViewModel(ITCPClient tcpClient, INanoLeafClient nanoLeafClient, IDimScreenService dimScreen) //public HomeComingPageViewModel() { _tcpClient = tcpClient; _nanoLeafClient = nanoLeafClient; _dimScreen = dimScreen; // Create the command - calls Do...Commands. homeComingOnCommand = new Command(DoHomeComingOnCommand); homeComingOffCommand = new Command(DoHomeComingOffCommand); lightUpScreenCommand = new Command(DoLightUpScreenCommand); }
public NanoLeafSettings(INanoLeafClient nanoLeafClient) { _nanoLeafClient = nanoLeafClient; NanoLeafDevices.Add(new NanoLeafDevice { Name = "NanoLeaf Wohnzimmer", Address = "192.168.1.136", HomeComing = true }); NanoLeafDevices.Add(new NanoLeafDevice { Name = "NanoLeaf Küche", Address = "192.168.1.34", HomeComing = true }); _nanoLeafClient.LoadAuhtTokenFromSettings(); }
public LightsPageViewModel(ITCPClient tcpClient, INanoLeafClient nanoLeafClient) { TcpLightControl = new Contorls.TcpSwitchControl(tcpClient); TcpLedControl = new Contorls.TcpLedControl(tcpClient); NanoLeafControl = new Contorls.NanoLeafControl(nanoLeafClient); }