Esempio n. 1
0
 public User()
 {
     MLB = new Team { Abbreviation = "NONE" };
     NFL = new Team { Abbreviation = "NONE" };
     NBA = new Team { Abbreviation = "NONE" };
     NHL = new Team { Abbreviation = "NONE" };
     MLS = new Team { Abbreviation = "NONE" };
     MiLB = new Team { Abbreviation = "NONE" };
     FAPL = new Team { Abbreviation = "NONE" };
 }
 private Image BuildImage(Team team)
 {
     Image image = new Image();
     image.Width = 100;
     image.Height = 100;
     image.Margin = new Thickness(0, 0, 10, 10);
     image.Tap += Team_Tap;
     image.DataContext = team;
     Uri uri = new Uri("Assets/Logos/" + team.League + "/" + team.Abbreviation + ".png", UriKind.Relative);
     ImageSource imageSource = new BitmapImage(uri);
     image.Source = imageSource;
     return image;
 }
 private Image BuildImage(Team t, string position)
 {
     Image image = new Image();
     image.Name = position;
     image.Width = 120;
     image.Height = 120;
     image.Tap += Team_Tap;
     image.DataContext = t;
     Uri uri = new Uri("Assets/Logos/" + t.League + "/" + t.Abbreviation + ".png", UriKind.Relative);
     ImageSource imageSource = new BitmapImage(uri);
     image.Source = imageSource;
     return image;
 }
 private void SaveTeam(string league, Team t)
 {
     switch (league)
     {
         case "MLB":
             App.Fan.MLB = t;
             break;
         case "NFL":
             App.Fan.NFL = t;
             break;
         case "NBA":
             App.Fan.NBA = t;
             break;
         case "NHL":
             App.Fan.NHL = t;
             break;
         case "MLS":
             App.Fan.MLS = t;
             break;
         case "MiLB":
             App.Fan.MiLB = t;
             break;
         case "FAPL":
             App.Fan.FAPL = t;
             break;
     }
     App.Settings["Fan"] = App.Fan;
     App.Settings.Save();
 }