/// <summary>
 /// Can be used when need to create new flash card. No help providers will appear.
 /// </summary>
 public FlashCardDetails()
 {
     AllTags           = new ObservableCollection <string>();
     flashCardFactory  = new FlashCardFactory();
     ReturnedFlashCard = flashCardFactory.GetFlashCard();
     canSaveFlashCard  = true;
     canMaterializeFlashCardAnserws = true;
 }
Esempio n. 2
0
        void EditSelectedFlashCard()
        {
            using (var repo = new FlashCardRepository())
            {
                FlashCardFactory    flashCardFactory    = new FlashCardFactory();
                FlashCardTagFactory flashCardTagFactory = new FlashCardTagFactory();
                var addFlashCardWindow = new FlashCardDetailsWindow(
                    new FlashCardDetails(flashCardFactory.GetFlashCard(selectedFlashCard.Id), flashCardTagFactory.GetAllTags())
                    );
                addFlashCardWindow.ShowDialog();

                if (addFlashCardWindow.addFlashCard.Save)
                {
                    repo.Save(addFlashCardWindow.addFlashCard.ReturnedFlashCard);
                }
            }
            UpdateFlashCardPreview();
        }
 /// <summary>
 /// Can be used when class has to load flash card on it's own
 /// </summary>
 /// <param name="flashCardId"></param>
 public FlashCardDetails(int flashCardId) : this()
 {
     this.ReturnedFlashCard = flashCardFactory.GetFlashCard(flashCardId);
 }