Ejemplo n.º 1
0
        public static async Task <HueObjectCollectionBase <Bridge> > GetBridges()
        {
            var bridgeFinder = new BridgeFinder();
            var connection   = new HueConnection {
                Throttle = true
            };

            return((HueObjectCollectionBase <Bridge>) await bridgeFinder.GetBridgesAsync(connection));
        }
Ejemplo n.º 2
0
        protected HueAppViewModel(ISettings settings, IDelegateCommandFactory commandFactory, IMessageHandler messageHandler)
        {
            _connection = new HueConnection {
                Throttle = true
            };
            _bridgeFinder = new BridgeFinder();
            Bridges       = new ObservableCollection <BridgeViewModel>();

            _settings       = settings;
            _commandFactory = commandFactory;
            MessageHandler  = messageHandler;

            ScanBridgesCommand = _commandFactory.CreateCommand(ExecuteScanBridgesAsync, CanExecuteScanBridges);
            ExecuteScanBridgesAsync();

            SaveCommand = _commandFactory.CreateCommand(ExecuteSave, CanExecuteSave);
        }