Exemplo n.º 1
0
        public void SetStartValue()
        {
            if (AppSettings.Values["countGamers"] != null)
            {
                CountGamers = (int)AppSettings.Values["countGamers"];
                TBCountGamers.Text = CountGamers.ToString();
            }
            else
            {
                CountGamers = Convert.ToInt32(TBCountGamers.Text);
            }

            if (AppSettings.Values["numberBottle"] != null)
            {
                NumberBottle = (int)AppSettings.Values["numberBottle"];
            }
            else
            {
                NumberBottle = 1;
            }
            bottle = bottleRepository.GetBottle(NumberBottle);
            bottleImage.Source = new BitmapImage(new Uri(bottle.Path, UriKind.RelativeOrAbsolute));

            if (AppSettings.Values["numberBackground"] != null)
            {
                NumberBackground = (int)AppSettings.Values["numberBackground"];
            }
            else
            {
                NumberBackground = 1;
            }
            background = backgroundRepository.GetBackground(NumberBackground);
            BackgroundImage.Source = new BitmapImage(new Uri(background.Path, UriKind.RelativeOrAbsolute));
            ImageBrush img = new ImageBrush();
            img.ImageSource = new BitmapImage(new Uri(background.Path, UriKind.RelativeOrAbsolute));
            SettingsGrid.Background = img;
            CountBottle = bottleRepository.GetCountBottle();
            CountBackground = backgroundRepository.GetCountBackground();
        }
Exemplo n.º 2
0
 private void ReductionBottle_Tap(object sender, TappedRoutedEventArgs e)
 {
     if (1 != NumberBottle)
     {
         NumberBottle--;
     }
     else
     {
         NumberBottle = CountBottle;
     }
     bottle = bottleRepository.GetBottle(NumberBottle);
     bottleImage.Source = new BitmapImage(new Uri(bottle.Path, UriKind.RelativeOrAbsolute));
 }