示例#1
0
 private async Task <bool> SaveDeck(StorageFile file)
 {
     if (file != null)
     {
         DeckPackageProcessor dpp = new DeckPackageProcessor();
         return(await dpp.writePackageAsync(file, this.currentDeck));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 private async void loadData(StorageFile file) {
     //File Picker, feed to processor, wait and show progress
     DeckPackageProcessor dpp = new DeckPackageProcessor();
     progring.IsEnabled = true;
     progring.IsActive = true;
     await dpp.readPackageAsync(file);
     //Once we're done, kill progress, set up controls, and update the display
     progring.IsEnabled = false;
     progring.IsActive = false;
     NextCardBtn.Visibility = Visibility.Visible;
     PrevCardBtn.Visibility = Visibility.Visible;
     this.currentDeck = dpp.deck;
     this.currentDeck.shuffle();
     this.DataContext = this.currentDeck;
     CardStackPanel.DataContext = this.currentDeck.getNextCard();
     this.updateVisibleCard();
 }
示例#3
0
        private async void loadData(StorageFile file)
        {
            //File Picker, feed to processor, wait and show progress
            DeckPackageProcessor dpp = new DeckPackageProcessor();

            progring.IsEnabled = true;
            progring.IsActive  = true;
            await dpp.readPackageAsync(file);

            //Once we're done, kill progress, set up controls, and update the display
            progring.IsEnabled     = false;
            progring.IsActive      = false;
            NextCardBtn.Visibility = Visibility.Visible;
            PrevCardBtn.Visibility = Visibility.Visible;
            this.currentDeck       = dpp.deck;
            this.currentDeck.shuffle();
            this.DataContext           = this.currentDeck;
            CardStackPanel.DataContext = this.currentDeck.getNextCard();
            this.updateVisibleCard();
        }
示例#4
0
        private async void loadDeckFromFile(StorageFile file)
        {
            //File Picker, feed to processor, wait and show progress
            DeckPackageProcessor dpp = new DeckPackageProcessor();

            progressRing.IsEnabled = true;
            progressRing.IsActive  = true;
            if (await dpp.readPackageAsync(file))
            {
                //Once we're done, kill progress, set up controls, and update the display
                progressRing.IsEnabled = false;
                progressRing.IsActive  = false;
                this.currentDeck       = dpp.deck;
                this.DataContext       = this.currentDeck;
            }
            else
            {
                Windows.UI.Popups.MessageDialog errorDialog = new Windows.UI.Popups.MessageDialog("There was a problem loading the file you selected. Make sure you've selected a valid QuizCards deck.", "Uh oh! I couldn't load that file.");
                await errorDialog.ShowAsync();

                Frame.Navigate(typeof(LandingPage));
            }
            //CardsGridView.DataContext = this.currentDeck;
        }
 private async void loadDeckFromFile(StorageFile file)
 {
     //File Picker, feed to processor, wait and show progress
     DeckPackageProcessor dpp = new DeckPackageProcessor();
     progressRing.IsEnabled = true;
     progressRing.IsActive = true;
     if (await dpp.readPackageAsync(file))
     {
         //Once we're done, kill progress, set up controls, and update the display
         progressRing.IsEnabled = false;
         progressRing.IsActive = false;
         this.currentDeck = dpp.deck;
         this.DataContext = this.currentDeck;
     }
     else
     {
         Windows.UI.Popups.MessageDialog errorDialog = new Windows.UI.Popups.MessageDialog("There was a problem loading the file you selected. Make sure you've selected a valid QuizCards deck.", "Uh oh! I couldn't load that file.");
         await errorDialog.ShowAsync();
         Frame.Navigate(typeof(LandingPage));
     }
     //CardsGridView.DataContext = this.currentDeck;       
 }
 private async Task<bool> SaveDeck(StorageFile file)
 {
     if (file != null)
     {
         DeckPackageProcessor dpp = new DeckPackageProcessor();
         return await dpp.writePackageAsync(file, this.currentDeck);
     }
     else
     {
         return false;
     }
 }