コード例 #1
0
        private void InitializeSwitchCommand()
        {
            switchcommand = new Command(() =>
            {
                On = !On;

                if (On)
                {
                    Relay.SwitchOn();
                }
                else
                {
                    Relay.SwitchOff();
                }

                Lamps.First().On = On;
            });
        }
コード例 #2
0
 private void InitializeSwitchCommand()
 {
     switchcommand = new Command(async () =>
     {
         var lamp = await client.Request(SwitchLamp,new Lamp() { Id = 0 });
         On = lamp.On;
     });
 }