Exemplo n.º 1
0
        private void Bookmarks_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            var bookmarks = Bookmark.ExtractBookmarks(e.NewItems);

            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                AddBookmarksToMenu(bookmarks);
            }
        }
Exemplo n.º 2
0
        private void Bookmarks_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                var added = Bookmark.ExtractBookmarks(e.NewItems);
                AddBookmarks(added);
                break;

            case NotifyCollectionChangedAction.Remove:
                var removed = Bookmark.ExtractBookmarks(e.OldItems);
                RemoveBookmarks(removed);
                break;
            }
        }