protected virtual void OnLibraryItemRemoved(LibraryRemovedEventArgs args)
 {
     if (LibraryItemRemoved != null)
     {
         LibraryItemRemoved(this, args);
     }
 }
        private void UpdateParentOnLibraryItemRemoved(object sender, LibraryRemovedEventArgs args)
        {
            LibraryModelItem item = args.RemovedItem as LibraryModelItem;

            if (args.RemovedItem is MediaItemsListModelItem)
            {
                CategoryModelItem parent = (from parentItem in CategoryItems where parentItem.Id == item.ParentId select parentItem).FirstOrDefault();
                if (parent != null)
                {
                    parent.RemoveChild(item as MediaItemsListModelItem);
                }
            }
            else if (args.RemovedItem is CategoryModelItem)
            {
                CatalogueModelItem parent = (from parentItem in CatalogueItems where parentItem.Id == item.ParentId select parentItem).FirstOrDefault();
                if (parent != null)
                {
                    int childrenCount = (from categoryItem in CategoryItems where categoryItem.ParentId == item.ParentId select categoryItem).Count();
                    parent.Subtitle = CatalogueModelItem.GetSubtitleString(childrenCount);
                }
            }
            // Currently there is no need to handle CatalogueModelItem removal
        }
 private void UpdateParentOnLibraryItemRemoved( object sender, LibraryRemovedEventArgs args )
 {
     LibraryModelItem item = args.RemovedItem as LibraryModelItem;
     if( args.RemovedItem is MediaItemsListModelItem )
     {
         CategoryModelItem parent = ( from parentItem in CategoryItems where parentItem.Id == item.ParentId select parentItem ).FirstOrDefault();
         if( parent != null )
         {
             parent.RemoveChild( item as MediaItemsListModelItem );
         }
     }
     else if( args.RemovedItem is CategoryModelItem )
     {
         CatalogueModelItem parent = ( from parentItem in CatalogueItems where parentItem.Id == item.ParentId select parentItem ).FirstOrDefault();
         if( parent != null )
         {
             int childrenCount = ( from categoryItem in CategoryItems where categoryItem.ParentId == item.ParentId select categoryItem ).Count();
             parent.Subtitle = CatalogueModelItem.GetSubtitleString( childrenCount );
         }
     }
     // Currently there is no need to handle CatalogueModelItem removal
 }
 protected virtual void OnLibraryItemRemoved( LibraryRemovedEventArgs args )
 {
     if( LibraryItemRemoved != null )
     {
         LibraryItemRemoved( this, args );
     }
 }