<?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: Access one Page ViewModel from another Page ViewModel in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856981#M4549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! We ended up doing something similar by calling PropertySheet.Page(_pageID) from various Page view models that needed to access one another. Along with some logic to ensure certain view models were already initialized and subscribed to certain events, it's working as needed.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2019 18:45:20 GMT</pubDate>
    <dc:creator>DavidLaMartina</dc:creator>
    <dc:date>2019-10-30T18:45:20Z</dc:date>
    <item>
      <title>Access one Page ViewModel from another Page ViewModel</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856978#M4546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To avoid creating another complex object within our Add-In's primary Module class, we'd like to have some our Page View Models (used in our custom Options pages) access one another. Is there any kind of built-in or best practice way of doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given the singleton nature of Dockpanes, it seems like this would be possible in that context (something like a call to&amp;nbsp;FrameworkApplication.DockPaneManager.Find(_dockPaneID within another dock pane), where _dockPaneID is known, and we cast the result to whatever specific DockPane subclass we need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, there's the "Current" scheme used with Modules, which just returns the result of a call to FindModule(_moduleID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something analogous to be done with Pages? If not, has anyone achieved something similar using a different scheme? Ultimately, we just need various options Pages to know about each other's changed properties, which represent the settings of our Add-In.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856978#M4546</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2019-10-22T13:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Access one Page ViewModel from another Page ViewModel</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856979#M4547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;That question is more about wpf developing then ArcGIS Pro API. If you use some framework (Prism or etc.) for developing wpf application so can check your framework for solution you need. If you use plane wpf as I do then&amp;nbsp;you can&amp;nbsp;use messaging:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/23798425/wpf-mvvm-communication-between-view-model"&gt;https://stackoverflow.com/questions/23798425/wpf-mvvm-communication-between-view-model&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use it in my projects to communicate between pages, pages and parent of pages and etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2019 06:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856979#M4547</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2019-10-24T06:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Access one Page ViewModel from another Page ViewModel</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856980#M4548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a few samples in the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples" rel="nofollow noopener noreferrer" target="_blank"&gt;arcgis-pro-sdk-community-samples repo&lt;/A&gt; where view models can be accessed from other user controls or other class files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code snippet similar to this is used in &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MagnifierWindow" rel="nofollow noopener noreferrer" target="_blank"&gt;MagnifierWindow sample&lt;/A&gt;:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;internal&lt;/SPAN&gt; MapControlWindow_ViewModel viewModel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//member variable&lt;/SPAN&gt;

 viewModel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapControlWindow_ViewModel&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;//Now you can access the public methods and properties in the viewmodel like this&lt;/SPAN&gt;
viewModel &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;UpdateMapControlContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code snippet in&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Content/MetadataBrowserControl" rel="nofollow noopener noreferrer" target="_blank"&gt;MetadataBrowserControl&lt;/A&gt;&amp;nbsp;sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//The viewmodel&lt;/SPAN&gt;
MetadataBrowserViewModel vm &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FrameworkApplication&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DockPaneManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Find&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MetadataBrowserControl_Dockpane1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; MetadataBrowserViewModel&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
vm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DockpaneVisible &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Windows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Visibility&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Visible&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//Visibility is set‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856980#M4548</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-12-12T10:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Access one Page ViewModel from another Page ViewModel</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856981#M4549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! We ended up doing something similar by calling PropertySheet.Page(_pageID) from various Page view models that needed to access one another. Along with some logic to ensure certain view models were already initialized and subscribed to certain events, it's working as needed.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2019 18:45:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/access-one-page-viewmodel-from-another-page/m-p/856981#M4549</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2019-10-30T18:45:20Z</dc:date>
    </item>
  </channel>
</rss>

