Exemple #1
0
 override protected void Clear()
 {
     base.Clear();
     emitEvent     = false;
     cancelClicked = false;
     SelectedTags.Clear();
 }
        private void LoadTags()
        {
            if (!InitialDataLoaded)
            {
                return;
            }

            Tags = new ObservableCollection <ITag>(dataService.GetTagsWithAssociatedEntitiesCount());
            SelectedTags.Clear();
        }
Exemple #3
0
 public IllustrationPageViewModel()
 {
     Browsing = new Observable <BrowseKind>(BrowseKind.Bookmark, (sender, args) =>
     {
         CurrentlyViewing = args.NewValue switch
         {
             BrowseKind.Upload => Uploads,
             BrowseKind.Bookmark => Bookmarks,
             _ => throw new ArgumentOutOfRangeException()
         };
         SelectedTags.Clear();
     });
Exemple #4
0
        /// <summary>
        /// Removes a tag from the collection
        /// </summary>
        internal void RemoveTag(EvernoteTagItem tag, bool cancelEvent = false)
        {
            if (this.ItemsSource != null)
            {
                ((IList)this.ItemsSource).Remove(tag); // assume IList for convenience
                SelectedTags.Clear();
                SelectedTags.AddRange(((List <EvernoteTagItem>) this.ItemsSource).Select(d => d.DataContext as ITag));
                this.Items.Refresh();

                if (TagRemoved != null && !cancelEvent)
                {
                    TagRemoved(this, new EvernoteTagEventArgs(tag));
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// Adds a tag to the collection
        /// </summary>
        internal void AddTag(EvernoteTagItem tag)
        {
            if (this.ItemsSource == null)
            {
                this.ItemsSource = new List <EvernoteTagItem>();
            }

            ((IList)this.ItemsSource).Add(tag); // assume IList for convenience
            SelectedTags.Clear();
            SelectedTags.AddRange(((List <EvernoteTagItem>) this.ItemsSource).Select(d => d.DataContext as ITag));
            this.Items.Refresh();

            if (TagAdded != null)
            {
                TagAdded(this, new EvernoteTagEventArgs(tag));
            }
        }
        private void OnClearSelectedTagsCommand(object parameter)
        {
            if (SelectedTags == null)
            {
                return;
            }

            if (SelectedTags.Count == 0)
            {
                return;
            }

            foreach (var st in SelectedTags)
            {
                if (!Tags.Contains(st))
                {
                    Tags.Add(st);
                }
            }

            SelectedTags.Clear();

            FilterTaggedObjects();
        }
Exemple #7
0
 private void ClearFilter()
 {
     SelectedTags.Clear();
     SelectedTagsAsString      = EMPTY_TAG_LIST;
     IsClearTagSelectedVisible = false;
 }