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

            Tags = new ObservableCollection <ITag>(dataService.GetTagsWithAssociatedEntitiesCount());
            SelectedTags.Clear();
        }
Ejemplo n.º 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();
     });
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
 private void ClearFilter()
 {
     SelectedTags.Clear();
     SelectedTagsAsString      = EMPTY_TAG_LIST;
     IsClearTagSelectedVisible = false;
 }