Parameters
- project
- The current ArcGIS Pro project to which the style has to be added.
- styleName
- Name of a core ArcGIS Pro style or the full path to a style file (.stylx) on disk that has to be added to the current project.
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method must be called within the lambda passed to QueuedTask.Run |
{
//For ArcGIS Pro system styles, just pass in the name of the style to add to the project
//Note: Needs QueuedTask to run
StyleHelper.AddStyle(Project.Current, "3D Vehicles");
//For custom styles, pass in the full path to the style file on disk
//Note: Needs QueuedTask to run
string customStyleToAdd = @"C:\Temp\CustomStyle.stylx";
StyleHelper.AddStyle(Project.Current, customStyleToAdd);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)