<?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: Confusing - MVVM WPF and Commands in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854228#M4396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;Pro implements its own MVVM framework.&amp;nbsp; You can see this when you use Pro SDK templates such as Dockpane. The dockpane item template (available using the Pro SDK in Visual Studio) stubs out the View (XAML user control and code behind file) with the View Model class file.&amp;nbsp; You can also check out the various samples in the arcgis-pro-sdk-community-samples repo for examples of Pro's implementation of MVVM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your specific scenario, you set the Datacontext of your ProWindow to the "ViewModel" class file. This view model should inherit from ArcGIS.Desktop,Framework.Contracts.PropertyChangedBase base class. I made a simple mockup of a login prowindow sample.&amp;nbsp; Attached.&lt;/P&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>Sat, 02 Nov 2019 00:01:29 GMT</pubDate>
    <dc:creator>UmaHarano</dc:creator>
    <dc:date>2019-11-02T00:01:29Z</dc:date>
    <item>
      <title>Confusing - MVVM WPF and Commands</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854227#M4395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I'm getting totally confused with WPF and how it works with MVVM and ESRI's SDK. I need to know where the most helpul, most appropriate resources are for this kind of development.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;At the moment I'm getting hung up over Commands and&amp;nbsp;ArcGIS.Desktop.Framework.Controls.ProWindow.&amp;nbsp; It's just a simple user login interface and trying to figure out how the &lt;STRONG&gt;Login&lt;/STRONG&gt;&amp;nbsp;button should activate/light up.&amp;nbsp; Obviously I want to enable it when the user enters a username and password - but it's so confusing when you try to implement a command -&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;OL style="padding: 0px 0px 0px 30px;"&gt;   &lt;LI style="margin: 0.2em 0px;"&gt;Should I just use simple code behind?&lt;/LI&gt;   &lt;LI style="margin: 0.2em 0px;"&gt;Should I build out an elaborate MVVM solution of my own making?&lt;/LI&gt;   &lt;LI style="margin: 0.2em 0px;"&gt;Should I use Prism or ActiPro or some other 3rd Party library?&lt;/LI&gt; &lt;/OL&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;When you start binding objects its hard to know which way you should bind, do you do it all in the XAML or all in code or a bit of both, what is the right way? There is no obvious way despite looking at tons of different tutorials and videos on the subject. Everyone has a slightly different way of doing things.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;STRONG&gt;Main Question&lt;/STRONG&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;How do you pass a binded object for evaluation through the command implementation? That is, the object is a "User" which is the Model (wrapped up in the ViewModel class) and has properties or Username, Password, PortalUrl - the UserViewModel comprises the User object and exposes it's inner properties of the User object so it can bind - but then I find it confusing trying to use a Command to check the object to see if its valid (i.e. completed out username/password/portalurl).&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Maybe&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I am over complicating things for something this simple, but on the other hand I want to do things the right way and not just hack something together. In the end I will be putting together a more complex UI and I will need to know this stuff in any case so I may as well learn it now with something simple.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;If anyone can help put me on the right track I would appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 15:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854227#M4395</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2019-10-31T15:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Confusing - MVVM WPF and Commands</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854228#M4396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simon,&lt;/P&gt;&lt;P&gt;Pro implements its own MVVM framework.&amp;nbsp; You can see this when you use Pro SDK templates such as Dockpane. The dockpane item template (available using the Pro SDK in Visual Studio) stubs out the View (XAML user control and code behind file) with the View Model class file.&amp;nbsp; You can also check out the various samples in the arcgis-pro-sdk-community-samples repo for examples of Pro's implementation of MVVM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your specific scenario, you set the Datacontext of your ProWindow to the "ViewModel" class file. This view model should inherit from ArcGIS.Desktop,Framework.Contracts.PropertyChangedBase base class. I made a simple mockup of a login prowindow sample.&amp;nbsp; Attached.&lt;/P&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>Sat, 02 Nov 2019 00:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854228#M4396</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2019-11-02T00:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Confusing - MVVM WPF and Commands</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854229#M4397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uma,&lt;/P&gt;&lt;P&gt;Many thanks - that's super helpful, simple I know, but I done some things the same as what you have done and some other things I didn't know about (e.g. a RelayCommand already exists to make use of). Really appreciated!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2019 16:19:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/confusing-mvvm-wpf-and-commands/m-p/854229#M4397</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2019-11-04T16:19:50Z</dc:date>
    </item>
  </channel>
</rss>

