public ExportViewModel()
        {
            // initialize selection lists
            GameModes   = Enum.GetValues(typeof(GameMode)).OfType <GameMode>();
            GameFormats = Enum.GetValues(typeof(GameFormat)).OfType <GameFormat>();
            TimePeriods = Enum.GetValues(typeof(TimeFrame)).OfType <TimeFrame>();
            Regions     = Enum.GetValues(typeof(Region)).OfType <Region>().Where(x => x != Region.UNKNOWN);
            Decks       = new ObservableCollection <Deck>();
            Exporters   = new List <IStatsConverter>()
            {
                new CSVConverter(),
                new OpenXMLConverter()
            };
            // set default selections
            CouldBeArena       = false;
            StatusObj          = new ToastViewModel();
            SelectedGameMode   = GameMode.NONE;
            SelectedGameFormat = GameFormat.ANY;
            SelectedRegion     = Region.US;
            SelectedTimeFrame  = TimeFrame.ALL;
            SelectedExporter   = Exporters.FirstOrDefault();

            PropertyChanged += ExportViewModel_PropertyChanged;
            ExportCommand    = new RelayCommand(async() => await ExportStats());

            // trigger update with a property change
            SelectedGameMode = GameMode.ALL;
        }
Пример #2
0
 public ImportViewModel()
 {
     Importers = new List <IStatsConverter>()
     {
         new CSVConverter(),
         new OpenXMLConverter()
     };
     StatusObj        = new ToastViewModel();
     SelectedImporter = Importers.FirstOrDefault();
     ImportCommand    = new RelayCommand(async() => await ImportGames());
 }