示例#1
0
 public MainPage()
 {
     InitializeComponent();
     bottleRepository = new BottleRepository();
     backgroundRepository = new BackgroundRepository();
     SetStartValue();
 }
示例#2
0
 public Game()
 {
     InitializeComponent();
     CurrentGamer = 1;
     random = new Random();
     resourceLoader = new ResourceLoader();
     backgroundRepository = new BackgroundRepository();
     bottleRepository = new BottleRepository();
 }
示例#3
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     BackgroundRepository backgroundRepository = new BackgroundRepository();
     BottleRepository bottleRepository = new BottleRepository();
     string[] parameters = e.Parameter.ToString().Split(',');
     CountGamers = Convert.ToInt32(parameters[0]);
     numberBottle = Convert.ToInt32(parameters[1]);
     int numberBackground = Convert.ToInt32(parameters[2]);
     ImageBrush img = new ImageBrush();
     img.ImageSource = new BitmapImage(new Uri(backgroundRepository.GetBackground(numberBackground).Path, UriKind.RelativeOrAbsolute));
     LayoutRoot.Background = img;
     colorLine = backgroundRepository.GetBackground(numberBackground).ColorLine;
     CurrentGamerLabel.Foreground = new SolidColorBrush(colorLine);
     CurrentGamerLabel.Text = string.Format(resourceLoader.GetString("CurrentGamer/Text"), CurrentGamer);
     Desires = GetListDesires();
 }