ArcGIS Pro 2.7 API Reference Guide
AddItem Method (StyleHelper)
Example 

ArcGIS.Desktop.Mapping Namespace > StyleHelper Class : AddItem Method
The StyleProjectItem to which StyleItem will be added.
The StyleItem to be added.
Adds a style item to a style. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static void AddItem( 
   StyleProjectItem styleProjectItem,
   StyleItem item
)
Public Shared Sub AddItem( _
   ByVal styleProjectItem As StyleProjectItem, _
   ByVal item As StyleItem _
) 

Parameters

styleProjectItem
The StyleProjectItem to which StyleItem will be added.
item
The StyleItem to be added.
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run
Adding an item cannot be performed on a read-only style.
The item could not be added to the style. The key may not be unique.
Example
public Task AddStyleItemAsync(StyleProjectItem style, StyleItem itemToAdd)
{
  return QueuedTask.Run(() =>
  {
    if (style == null || itemToAdd == null)
      throw new System.ArgumentNullException();

    //Add the item to style
    style.AddItem(itemToAdd);
  });
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

StyleHelper Class
StyleHelper Members