예제 #1
0
        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")
            });
        }
예제 #2
0
        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);
        }
예제 #3
0
 private void OnLoaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     AppServiceBridge.RequestReceived += PropertyUpdate;
     AppServiceBridge.RequestUpdate(new List <string> {
         "ConfigNewsMarket", "ConfigNewsCategory", "ConfigWeatherContryCode", "ConfigWeatherZipCode", "ConfigTemperatureUnit"
     });
 }
예제 #4
0
 public OpenWeatherMap()
 {
     AppServiceBridge.RequestReceived += PropertyUpdate;
     AppServiceBridge.RequestUpdate("OpenWeatherMapKey");
     AppServiceBridge.RequestUpdate("ConfigWeatherZipCode");
     AppServiceBridge.RequestUpdate("ConfigWeatherContryCode");
 }
예제 #5
0
 public BingNews()
 {
     AppServiceBridge.RequestReceived += PropertyUpdate;
     AppServiceBridge.RequestUpdate("ConfigNewsMarket");
     AppServiceBridge.RequestUpdate("ConfigNewsCategory");
     AppServiceBridge.RequestUpdate("bingKey");
 }
예제 #6
0
        private async void OnLoaded(object sender, RoutedEventArgs e)
        {
            await AppServiceBridge.InitAsync();

            new TextToSpeech("Welcome").Play();
            _voiceCommand.AddCommands(_voiceCallbacks);
            ContentNavigate(typeof(NewsAndWeather));
        }
예제 #7
0
 private async void ToggleBackground_Click(object sender, RoutedEventArgs e)
 {
     _whiteBackground = !_whiteBackground;
     SetBackground(_whiteBackground ? WHITE : BLACK);
     await AppServiceBridge.SendMessageAsync(new ValueSet
     {
         ["ConfigSlideShowBackgroundColor"] = _whiteBackground ? "white" : "black"
     });
 }
예제 #8
0
        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"
     });
 }