private async void SetTimePopup_ItemClick(object sender, ItemClickEventArgs e) { TextBlock item = e.ClickedItem as TextBlock; var currentDelay = FadeAnimation.Duration.TimeSpan.TotalMilliseconds; switch (item.Text) { case "Slower transition": currentDelay *= 2; break; case "Faster transition": currentDelay /= 2; break; default: Debug.WriteLine("Unknown popup option " + item.Text + "selected"); return; } SetTransitionDelay(currentDelay); await AppServiceBridge.SendMessageAsync(new ValueSet { ["ConfigSlideShowDuration"] = currentDelay.ToString("N3") }); }
private async void OnLoaded(object sender, RoutedEventArgs args) { AppServiceBridge.RequestReceived += PropertyUpdate; AppServiceBridge.RequestUpdate(new List <string> { "ConfigSlideShowBackgroundColor", "ConfigSlideShowStrech", "ConfigSlideShowDuration" }); try { await _oneDrive.InitAsync(); _images = await _oneDrive.GetImagesAsync(null); } catch (Exception e) { ShowError(e.Message); return; } if (_images.Count == 0) { ShowError("No images found in user's OneDrive."); return; } _hideControlsTimer.Start(); ForegroundImage.Source = BackgroundImage.Source = await LoadImage(_images[0].Id); Play(); _voiceCommand.AddCommands(_voiceCallbacks); }
private void OnLoaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) { AppServiceBridge.RequestReceived += PropertyUpdate; AppServiceBridge.RequestUpdate(new List <string> { "ConfigNewsMarket", "ConfigNewsCategory", "ConfigWeatherContryCode", "ConfigWeatherZipCode", "ConfigTemperatureUnit" }); }
public OpenWeatherMap() { AppServiceBridge.RequestReceived += PropertyUpdate; AppServiceBridge.RequestUpdate("OpenWeatherMapKey"); AppServiceBridge.RequestUpdate("ConfigWeatherZipCode"); AppServiceBridge.RequestUpdate("ConfigWeatherContryCode"); }
public BingNews() { AppServiceBridge.RequestReceived += PropertyUpdate; AppServiceBridge.RequestUpdate("ConfigNewsMarket"); AppServiceBridge.RequestUpdate("ConfigNewsCategory"); AppServiceBridge.RequestUpdate("bingKey"); }
private async void OnLoaded(object sender, RoutedEventArgs e) { await AppServiceBridge.InitAsync(); new TextToSpeech("Welcome").Play(); _voiceCommand.AddCommands(_voiceCallbacks); ContentNavigate(typeof(NewsAndWeather)); }
private async void ToggleBackground_Click(object sender, RoutedEventArgs e) { _whiteBackground = !_whiteBackground; SetBackground(_whiteBackground ? WHITE : BLACK); await AppServiceBridge.SendMessageAsync(new ValueSet { ["ConfigSlideShowBackgroundColor"] = _whiteBackground ? "white" : "black" }); }
private async void SetStretchTypePopup_ItemClick(object sender, ItemClickEventArgs e) { var stretch = ((TextBlock)e.ClickedItem).Text; SetStretch(stretch); await AppServiceBridge.SendMessageAsync(new ValueSet { ["ConfigSlideShowStrech"] = stretch }); }
private void OnLoaded(object sender, RoutedEventArgs e) { _bing.NewsUpdate += NewsUpdate; _bing.Start(); _weather.WeatherUpdate += WeatherUpdate; _weather.Start(); AppServiceBridge.RequestReceived += PropertyUpdate; AppServiceBridge.RequestUpdate(new List <string> { "ConfigTemperatureUnit", "temperature", "humidity", "pressure" }); }