ArcGIS Pro 2.7 API Reference Guide
CreateStyle Method
Example 

ArcGIS.Desktop.Mapping Namespace > StyleHelper Class : CreateStyle Method
The current ArcGIS Pro project to which the new style will be added.
The full path on disk of the new style file to be created.
Creates a new style file (.stylx) on disk and adds the style to the current project. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static void CreateStyle( 
   Project project,
   string styleName
)
Public Shared Sub CreateStyle( _
   ByVal project As Project, _
   ByVal styleName As String _
) 

Parameters

project
The current ArcGIS Pro project to which the new style will be added.
styleName
The full path on disk of the new style file to be created.
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run
Example
//Full path for the new style file (.stylx) to be created
string styleToCreate = @"C:\Temp\NewStyle.stylx";
await QueuedTask.Run(() => StyleHelper.CreateStyle(Project.Current, styleToCreate));
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

StyleHelper Class
StyleHelper Members