ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / FavoritesManager Class / RemoveFavorite Method
The item to remove from the favorite collection. For example a folder connection or a toolbox.
Example

In This Topic
    RemoveFavorite Method
    In This Topic
    Removes an item from the favorites collection.
    Syntax
    Public Sub RemoveFavorite( _
       ByVal item As Item _
    ) 
    public void RemoveFavorite( 
       Item item
    )

    Parameters

    item
    The item to remove from the favorite collection. For example a folder connection or a toolbox.
    Example
    Remove All Favorites
    {
      var favorites = FavoritesManager.Current.GetFavorites();
      foreach (var favorite in favorites)
        FavoritesManager.Current.RemoveFavorite(favorite.Item);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also