private void Init()
 {
     manage = new ManageImport();
     DataInizio.SelectedDate = DateTime.Today.AddMonths(-2);
     DataFine.SelectedDate = DateTime.Today;
     GameDetails.ItemsSource = manage.Data.Games;
     GameList.ItemsSource = manage.Data.GameList;
     SelectedGame = new Game();
     GameDetails.SelectionChanged += GameDetails_SelectionChanged;
 }
 public static Game Convert(Data d, List<Genre> genres, List<Platform> platforms)
 {
     Game g = new Game();
     g.ImportId = d.Game.id;
     g.Description = d.Game.Overview;
     g.Title = d.Game.GameTitle;
     if(!string.IsNullOrEmpty(d.Game.GameTitle))
         g.shortName = d.Game.GameTitle.RemoveMultipleSpace().Replace(" ", "-").Substring(0, Math.Min(d.Game.GameTitle.Length,20));
     g.Platform = GetPlatform(d.Game.PlatformId, platforms);
     g.Image = d.DowloadedFrontImage;
     g.Genre = GetGenre(d.Game.Genres.genre, genres);
     return g;
 }
 private Game AddGame()
 {
     Game g = new Game();
     g.Description = txtDescrizione.Text;
     g.Genre = (Genre)chbGenere.SelectedItem;
     g.Platform = (Platform)chbPiattaforma.SelectedItem;
     g.shortName = txtShortName.Text;
     g.Title = txtTitolo.Text;
     g.index = manage.Data.Games.Count + 1;
     if (CurrentImage != null)
         g.Image = CurrentImage;
     return g;
 }