<?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 Re: Managed configuration: binding in dockpane not working, and Initialize() not called in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1399752#M11274</link>
    <description>&lt;P&gt;Modules are lazy loaded when autoLoad=false - the default. Thus, the module initialize will fire when the first "action" occurs that triggers module loading - for example - a button click on the ribbon (which is the most common) or a previously open dockpane is re-opened at the beginning of the session. At that time, before _anything_ else, the Module is constructed (eg new Module1() {}) and Initialize is called. Then everything else.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously, the coding pattern for Initialize can get a bit tricky when autoLoad=false because the timing of when it will occur within a given session will change (depending on when the first action that triggers module loading occurs). Setting autoLoad=true means that the Module will always load at the same time at the beginning of the session regardless of when the first action or "use" occurs.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 17:50:56 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2024-03-22T17:50:56Z</dc:date>
    <item>
      <title>Managed configuration: binding in dockpane not working, and Initialize() not called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398400#M11254</link>
      <description>&lt;P&gt;I'm experiencing very strange behavior. I have two managed configurations. In the first, everything works fine. In the second, I'm running into the two following problems:&lt;/P&gt;&lt;P&gt;1. The binding in my dockpane is not working. The dockpane is referenced in the Config.daml as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;dockPane id="BiotopApp_View_Dockpanes_DockStart" caption="Objekt starten" className="BiotopApp.View.Dockpanes.DockStartViewModel" dock="group" dockWith="esri_core_projectDockPane"&amp;gt;
   &amp;lt;content className="BiotopApp.View.Dockpanes.DockStartView" /&amp;gt;
 &amp;lt;/dockPane&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I define a button in DockStart.xaml as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Button x:Name="btnStart" Content="Objekt starten" Command="{Binding CommandStartObject}" IsEnabled="{Binding CommandStartEnabled}" Background ="LightGreen" HorizontalAlignment="Left" Margin="202,493.4,0,0" Grid.Row="1" VerticalAlignment="Top" Width="108" RenderTransformOrigin="0.776,-0.2" Height="26"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code in DockStartViewModel for the button is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal ICommand CommandStartObject
{
	get
	{
		return new RelayCommand(async (args) =&amp;gt; await StartObjectAsync(), () =&amp;gt; true);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. When I start the managed configuration, the following method is never called:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class BiosModule : Module
{
    protected override bool Initialize()
    {		
	return base.Initialize();		
    }
    ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I overlooking? I am doing exactly the same things in both Managed Configurations.&lt;/P&gt;&lt;P&gt;One last question: how does the .xaml know to which class it is bound? It is &lt;STRONG&gt;not&lt;/STRONG&gt; the following line of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;d:DataContext="{Binding Path=DockStartViewModel}"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 13:54:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398400#M11254</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2024-03-20T13:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Managed configuration: binding in dockpane not working, and Initialize() not called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398441#M11256</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would suggest you to check dockpane 'classname' and dockpane's content 'classname' paths.&lt;/P&gt;&lt;P&gt;For dockpane viewmodel class is specified as 'classname' value and view class - as content&amp;nbsp;'classname' value.&lt;/P&gt;&lt;P&gt;DataContext is set inside dockpane's internal code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have noticed that you change module class name from Module1 to BiosModule. Have you changed Module class name in daml?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- &amp;lt;insertModule id="*******_Module" className="Module1" autoLoad="false" caption="Module1"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Setting autoLoad to true could help too.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 14:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398441#M11256</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-03-20T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Managed configuration: binding in dockpane not working, and Initialize() not called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398940#M11261</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/42133"&gt;@GKmieliauskas&lt;/a&gt;: Thank you for your reply!&lt;/P&gt;&lt;P&gt;1. I found out what caused the first problem. The implementation for the command in the ViewModel must be &lt;STRONG&gt;public&lt;/STRONG&gt;, not internal:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public ICommand CommandStartObject
{
	get
	{
		return new RelayCommand(async (args) =&amp;gt; await StartObjectAsync(), () =&amp;gt; true);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;2. You solved the second problem: if autoLoad in the Config.daml, is set to &lt;STRONG&gt;true&lt;/STRONG&gt;, the function Initialize() in the module is called:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; &amp;lt;insertModule id="BiotopApp_Module" className="BiosModule" autoLoad="true" caption="BiosModule"&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Mar 2024 12:06:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1398940#M11261</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2024-03-21T12:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Managed configuration: binding in dockpane not working, and Initialize() not called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1399752#M11274</link>
      <description>&lt;P&gt;Modules are lazy loaded when autoLoad=false - the default. Thus, the module initialize will fire when the first "action" occurs that triggers module loading - for example - a button click on the ribbon (which is the most common) or a previously open dockpane is re-opened at the beginning of the session. At that time, before _anything_ else, the Module is constructed (eg new Module1() {}) and Initialize is called. Then everything else.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously, the coding pattern for Initialize can get a bit tricky when autoLoad=false because the timing of when it will occur within a given session will change (depending on when the first action that triggers module loading occurs). Setting autoLoad=true means that the Module will always load at the same time at the beginning of the session regardless of when the first action or "use" occurs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 17:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1399752#M11274</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2024-03-22T17:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Managed configuration: binding in dockpane not working, and Initialize() not called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1400253#M11280</link>
      <description>&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;thank you for the clarification! I wasn't aware of it. This is very good to know, and it also explains why in one of my managed configurations, Initialize() was called, and in the other not. In both of them, autoLoad was set to false.&lt;/P&gt;&lt;P&gt;Actually, why is the default for autoLoad = false? Wouldn't it be easier for developers if it was true? At least, I wouldn't have run into my problem explained above...&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 09:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/managed-configuration-binding-in-dockpane-not/m-p/1400253#M11280</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2024-03-25T09:06:34Z</dc:date>
    </item>
  </channel>
</rss>

