예제 #1
0
        public void SetStartValue()
        {
            AppSettings = IsolatedStorageSettings.ApplicationSettings;
            if (AppSettings.Contains("countGamers"))
            {
                CountGamers = (int)AppSettings["countGamers"];
                TBCountGamers.Text = CountGamers.ToString();
            }
            else
            {
                CountGamers = Convert.ToInt32(TBCountGamers.Text);
            }

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

            if (AppSettings.Contains("numberBackground"))
            {
                NumberBackground = (int)AppSettings["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();
        }
예제 #2
0
 private void ReductionBottle_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     if (1 != NumberBottle)
     {
         NumberBottle--;
     }
     else
     {
         NumberBottle = CountBottle;
     }
     bottle = bottleRepository.GetBottle(NumberBottle);
     bottleImage.Source = new BitmapImage(new Uri(bottle.Path, UriKind.RelativeOrAbsolute));
 }