<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Show layer custom properties in Esri Layer dialog in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/show-layer-custom-properties-in-esri-layer-dialog/m-p/1267304#M9527</link>
    <description>&lt;P&gt;I created a Plugin Datasource layer that uses a proprietary file as a datasource. CustomProperties are added to this layer upon creation. Is there a way to show these values in the standard Esri layer property dialog where the custom properties are listed on the left along with General, Metadata, Source, etc?&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 21:07:43 GMT</pubDate>
    <dc:creator>StevenCorpus</dc:creator>
    <dc:date>2023-03-13T21:07:43Z</dc:date>
    <item>
      <title>Show layer custom properties in Esri Layer dialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/show-layer-custom-properties-in-esri-layer-dialog/m-p/1267304#M9527</link>
      <description>&lt;P&gt;I created a Plugin Datasource layer that uses a proprietary file as a datasource. CustomProperties are added to this layer upon creation. Is there a way to show these values in the standard Esri layer property dialog where the custom properties are listed on the left along with General, Metadata, Source, etc?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 21:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/show-layer-custom-properties-in-esri-layer-dialog/m-p/1267304#M9527</guid>
      <dc:creator>StevenCorpus</dc:creator>
      <dc:date>2023-03-13T21:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Show layer custom properties in Esri Layer dialog</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/show-layer-custom-properties-in-esri-layer-dialog/m-p/1267631#M9530</link>
      <description>&lt;P&gt;here's an example of a custom page for feature layers: - assuming u have added a property sheet/page to your addin (eg using the item template). The key is updating the desired property sheet collection. In this case, I am updating "esri_mapping_featureLayerPropertySheet" which is the collection for feature layers.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="layer_props1.jpg" style="width: 651px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65224iE83DCF5CCA293DCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="layer_props1.jpg" alt="layer_props1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="layer_props2.jpg" style="width: 640px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65225i6737EDC310E5E70D/image-size/large?v=v2&amp;amp;px=999" role="button" title="layer_props2.jpg" alt="layer_props2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Config.daml (note: by default the template uses "&amp;lt;page..." - note that for "&amp;lt;udpdateSheet" u need to use "&amp;lt;insertPage ..."&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;propertySheets&amp;gt;
    &amp;lt;updateSheet refID="esri_mapping_featureLayerPropertySheet"&amp;gt;
      &amp;lt;insertPage id="LayerPropertyPageExample_Pages_FeatureLayerCustomPage" 
						caption="Custom Page" className="LayerPropertyPageExample.Pages.FeatureLayerCustomPageViewModel" 
						group="Custom Group"&amp;gt;
        &amp;lt;content className="LayerPropertyPageExample.Pages.FeatureLayerCustomPageView" /&amp;gt;
      &amp;lt;/insertPage&amp;gt;
    &amp;lt;/updateSheet&amp;gt;
  &amp;lt;/propertySheets&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Module1.cs&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class Module1 : Module {
  ...
 protected override bool Initialize() {
   if (MapView.Active != null) {
     var layers = MapView.Active?.GetSelectedLayers().OfType&amp;lt;FeatureLayer&amp;gt;();
     if (layers?.Count() &amp;gt; 0) {
     var json_settings = new JsonSerializationSettings() {
        PrettyPrint = true
      };
      QueuedTask.Run(() =&amp;gt; LayerJSON = layers.First()
          .GetDefinition().ToJson(json_settings));
    }
   }
   ArcGIS.Desktop.Mapping.Events.TOCSelectionChangedEvent
      .Subscribe(async (args) =&amp;gt; {
   var layers = args.MapView?.GetSelectedLayers().OfType&amp;lt;FeatureLayer&amp;gt;();
   if (layers?.Count() &amp;gt; 0) {
     var json_settings = new JsonSerializationSettings() {
       PrettyPrint = true
     };
     LayerJSON = await QueuedTask.Run(() =&amp;gt; 
        layers.First().GetDefinition().ToJson(json_settings));
    }
   });
   return true;
 }

 private string _layerJSON = "";
 public string LayerJSON {
   get {
      return _layerJSON;
   }
   set {
      _layerJSON = value;
   }
 }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Property page View Model and View:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class FeatureLayerCustomPageViewModel : Page {
 ...
 public string LayerJSON =&amp;gt; Module1.Current.LayerJSON;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;UserControl x:Class="LayerPropertyPageExample.Pages.FeatureLayerCustomPageView"&amp;gt;
  ...
 &amp;lt;Grid&amp;gt;
  &amp;lt;Border BorderThickness="1" Padding="1"&amp;gt;
    &amp;lt;Border.BorderBrush&amp;gt;
      &amp;lt;SolidColorBrush Color="{DynamicResource Esri_Color_Blue}"&amp;gt;&amp;lt;/SolidColorBrush&amp;gt;
    &amp;lt;/Border.BorderBrush&amp;gt;
    &amp;lt;ScrollViewer HorizontalScrollBarVisibility="Auto"
		  VerticalScrollBarVisibility="Auto"&amp;gt;
     &amp;lt;TextBlock Text="{Binding LayerJSON}"  
                TextWrapping="Wrap"/&amp;gt;
   &amp;lt;/ScrollViewer&amp;gt;
  &amp;lt;/Border&amp;gt;
 &amp;lt;/Grid&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 16:18:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/show-layer-custom-properties-in-esri-layer-dialog/m-p/1267631#M9530</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-03-14T16:18:33Z</dc:date>
    </item>
  </channel>
</rss>

