<?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 Finding built-in Dockpane throws in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806830#M2210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;pane = FrameworkApplication.DockPaneManager.Find(&lt;SPAN class=""&gt;"esri_editing_AttributesDockPane"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;pane.Pin();&lt;/P&gt;&lt;P class=""&gt;pane.Activate(&lt;SPAN class=""&gt;true&lt;/SPAN&gt;);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;Will throw the following exception&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;System.AggregateException HResult=0x80131500 Message=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. Source=mscorlib StackTrace: at System.Threading.Tasks.TaskExceptionHolder.Finalize() Inner Exception 1: NullReferenceException: Object reference not set to an instance of an object.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not one single line will cause the issue. It's like the code queue's up some tasks and when they run, it will delayed fail. Upon further inspection, the calling code does nothing, but when trying to open the pane it will then throw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same thing seems to happen if the pane is visible if I comment out `Pin()` and/or `Activate(true)` it will still throw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've had similar experience with using the show attributes button command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is the proper way to display the attributes for a feature that has just been created so the user can directly start editing?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2018 01:26:14 GMT</pubDate>
    <dc:creator>stevegourley</dc:creator>
    <dc:date>2018-07-24T01:26:14Z</dc:date>
    <item>
      <title>Finding built-in Dockpane throws</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806830#M2210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;pane = FrameworkApplication.DockPaneManager.Find(&lt;SPAN class=""&gt;"esri_editing_AttributesDockPane"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;pane.Pin();&lt;/P&gt;&lt;P class=""&gt;pane.Activate(&lt;SPAN class=""&gt;true&lt;/SPAN&gt;);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;Will throw the following exception&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;System.AggregateException HResult=0x80131500 Message=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. Source=mscorlib StackTrace: at System.Threading.Tasks.TaskExceptionHolder.Finalize() Inner Exception 1: NullReferenceException: Object reference not set to an instance of an object.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not one single line will cause the issue. It's like the code queue's up some tasks and when they run, it will delayed fail. Upon further inspection, the calling code does nothing, but when trying to open the pane it will then throw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same thing seems to happen if the pane is visible if I comment out `Pin()` and/or `Activate(true)` it will still throw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've had similar experience with using the show attributes button command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is the proper way to display the attributes for a feature that has just been created so the user can directly start editing?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 01:26:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806830#M2210</guid>
      <dc:creator>stevegourley</dc:creator>
      <dc:date>2018-07-24T01:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Finding built-in Dockpane throws</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806831#M2211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you are on the UI thread (ie not on the background thread) when you call DockPaneManager.Find.&amp;nbsp; Dockpanes are created on the UI thread and should not be accessed on the CIM / background thread.&amp;nbsp; &amp;nbsp;I suspect this is why you are having this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 19:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806831#M2211</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2018-07-24T19:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Finding built-in Dockpane throws</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806832#M2212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh ok. I have been using the intellisense to know when something needs to run on the UI thread or the CIM thread as some things do mention that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;Application.Current.Dispatcher.Invoke(() =&amp;gt; {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; edits = FrameworkApplication.DockPaneManager.Find(&lt;SPAN class=""&gt;"esri_editing_AttributesDockPane"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;edits.Activate(&lt;SPAN class=""&gt;true&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;edits.Pin();&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;Throws the same error.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;The error is thrown if you create an edit operation, create a new row, my example has no geometry, and then run the code above in&amp;nbsp;a isSucceeded if statement.&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; operation.Create(layer, attributes);&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;await&lt;/SPAN&gt; operation.ExecuteAsync();&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; (operation.IsSucceeded) {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // run code above and error is thrown.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 19:43:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806832#M2212</guid>
      <dc:creator>stevegourley</dc:creator>
      <dc:date>2018-07-24T19:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Finding built-in Dockpane throws</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806833#M2213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still not seeing any problems.&amp;nbsp; &amp;nbsp;Here is a button click with a similar scenario to what you outlined - creating a feature with null geometry.&amp;nbsp; &amp;nbsp; I never see "boo" in a message box or get an exception.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What version of Pro are you using?.&amp;nbsp; &amp;nbsp; &amp;nbsp;Is there anything&amp;nbsp;particular about your data or the way you're calling the feature creation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;protected override async void OnClick()&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; bool result = await QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FeatureLayer featureLayer = MapView.Active.Map.FindLayers("Point_Paired").FirstOrDefault() as FeatureLayer;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (featureLayer == null)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; var editOperation = new EditOperation();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; var atts = new Dictionary&amp;lt;string, object&amp;gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; // create with empty attributes - no shape&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; editOperation.Create(featureLayer, atts);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; bool creationResult = await editOperation.ExecuteAsync();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (editOperation.IsSucceeded)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Application.Current.Dispatcher.Invoke(() =&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var pane = FrameworkApplication.DockPaneManager.Find("esri_editing_AttributesDockPane");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (pane != null)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pane.Pin();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pane.Activate();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("boo");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return creationResult;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2018 22:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806833#M2213</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2018-07-24T22:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Finding built-in Dockpane throws</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806834#M2214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this hasn't happened for a while. I will mark it as answered. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 14:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/finding-built-in-dockpane-throws/m-p/806834#M2214</guid>
      <dc:creator>stevegourley</dc:creator>
      <dc:date>2018-08-01T14:48:13Z</dc:date>
    </item>
  </channel>
</rss>

