示例#1
0
 private void SetupTagSelection()
 {
     tagInforViewModel                 = new TagInformationViewModel(collection, collection.NewNote());
     includeTags.ViewModel             = tagInforViewModel;
     includeTags.LabelVisibility       = Visibility.Collapsed;
     includeTags.Placement             = FlyoutPlacementMode.Bottom;
     includeTags.TagFlyoutClosedEvent += TagFlyoutClosedEventHandler;
 }
示例#2
0
 public static void AppendTags(StringBuilder tags, string prefix, TagInformationViewModel viewModel)
 {
     foreach (var tag in viewModel.CurrentNote.Tags)
     {
         tags.Append(prefix);
         tags.Append(tag);
         tags.Append(" ");
     }
 }
示例#3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            mainPage = e.Parameter as MainPage;
            if (mainPage == null)
            {
                throw new Exception("Wrong parameter type!");
            }
            collection = mainPage.Collection;
            ViewModel  = new TagInformationViewModel(collection, collection.NewNote());

            HookAllEvents();
        }
示例#4
0
        private void CramModeCheckedHandler(object sender, RoutedEventArgs e)
        {
            cramNumberBox.Number    = 1;
            cramNumberBox.MinNumber = 1;
            var deckIds = collection.Deck.Children(currentDeckId).Values.ToList();

            deckIds.Add(currentDeckId);
            cramNumberBox.MaxNumber        = collection.CardCount(deckIds);
            standardOptionsRoot.Visibility = Visibility.Collapsed;
            cramModeRoot.Visibility        = Visibility.Visible;
            if (includeTagsViewModel == null)
            {
                includeTagsViewModel  = new TagInformationViewModel(collection, collection.NewNote());
                excludeTagsViewModel  = new TagInformationViewModel(collection, collection.NewNote());
                includeTags.ViewModel = includeTagsViewModel;
                excludeTags.ViewModel = excludeTagsViewModel;
            }
            studyOption = CustomStudyOption.CramMode;
        }
示例#5
0
 private void SetupTagsView()
 {
     tagsViewModel      = new TagInformationViewModel(collection, currentNote);
     tagsView.ViewModel = tagsViewModel;
 }