//There is currently only one type of weather voice command //It is to show the weather of a certain time frame. Here we will simply //Update which time frame is currently visible public void HandleVoiceCommand(string timeFrame) { //Turn off the currently displayed element. currentlyVisible.Visible = Visibility.Collapsed; //Update currentlyVisible weather item based on the time frame from the voice command. switch (timeFrame) { case WeatherCommands.TIME_CURRENT: currentlyVisible = currentWeather; break; case WeatherCommands.TIME_TODAY: currentlyVisible = todaysWeather; break; case WeatherCommands.TIME_TOMORROW: currentlyVisible = tomorrowsWeather; break; case WeatherCommands.TIME_WEEK: currentlyVisible = weeksWeather; break; } //Turn the item that is supposed to be visible on currentlyVisible.Visible = Visibility.Visible; }
public WeatherPage(IWeatherViewModel weatherViewModel, IWeatherLocationDetailDataRetriever weatherLocationDetailDataRetriever) { this.InitializeComponent(); this.BindingContext = this.viewModel = weatherViewModel.CheckForNull(); this.DataRetriever = weatherLocationDetailDataRetriever.CheckForNull(); this.WeatherLocationSearchesListView.ItemsSource = this.viewModel.Items; }
public WeatherModel(WeatherCurrentViewModel current, WeatherDayViewModel today, WeatherDayViewModel tomorrow, WeatherWeekViewModel week) { currentWeather = current; todaysWeather = today; tomorrowsWeather = tomorrow; weeksWeather = week; currentlyVisible = currentWeather; VoiceController = new WeatherVoiceController("Grammar\\weatherGrammar.xml", this); }
public WeatherView(IWeatherViewModel viewModel) { InitializeComponent(); DataContext = viewModel; }
/// <summary> /// load all the data in the background so the user doesnt think the app is frozen /// </summary> private void LoadData() { _worker.DoWork += (s, a) => { Weather = _kernel.Get<IWeatherViewModel>(); Travel = _kernel.Get<ITravelViewModel>(); Dispatcher.CurrentDispatcher.InvokeShutdown(); }; _worker.RunWorkerCompleted += (s, args) => { Weather.ProxyImageLoaded = false; IsLoading = false; ShowWeather = true; ShowTravel = true; }; _worker.RunWorkerAsync("get data"); }