Ejemplo n.º 1
0
        // Constructor
        public WizControlPage(WizLightModel model)
        {
            BindingContext = model;
            InitializeComponent();

            // Set binding programmatically
            TempSlider.SetBinding(Slider.ValueProperty, "Temperature", BindingMode.TwoWay, new RangeToPercentConverter(model.MinimumTemperature, model.MaximumTemperature));
        }
        // called when a light is discovered
        public void WhenLightDiscovered(WizHandle handle)
        {
            foreach (WizLightModel light in lights)
            {
                if (light.MAC.ToLower() == handle.Mac.ToLower())
                {
                    return;
                }
            }
            WizLightModel model = new WizLightModel(handle);

            model.ShouldUpdate = true;
            lights.Add(model);
        }