<?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: WPF: cannot fill more than one combo boxes with domain values in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788258#M1359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Than Aung,&lt;/P&gt;&lt;P&gt;thank you for your reply! I already use the MVVM pattern using a ViewModel class. Yes, you are right, adding items to the combo box is not inside the MCT thread, so I removed the following code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;lock (lockObject)
{
&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt;&lt;P&gt;However, I need the following line of code because getting coded value pairs from domain is done inside the MCT thread:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;BindingOperations.EnableCollectionSynchronization(_streetItems, lockObject);&lt;/PRE&gt;&lt;P&gt;Otherwise, the combo box remains empty.&lt;/P&gt;&lt;P&gt;I still have the problem that I can only fill one combo box with the domain values. The other combo box (whether it is the first or the second) always remains empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:54:58 GMT</pubDate>
    <dc:creator>BarbaraSchneider2</dc:creator>
    <dc:date>2021-12-12T16:54:58Z</dc:date>
    <item>
      <title>WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788256#M1357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a ProWindow with two combo boxes on it. The combo box items are retrieved from coded value domains. I followed the guidelines for thread safe data binding with WPF on &lt;A class="link-titled" href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#locking-guidelines" title="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#locking-guidelines" rel="nofollow noopener noreferrer" target="_blank"&gt;ProConcepts Framework · Esri/arcgis-pro-sdk Wiki · GitHub&lt;/A&gt; (section &lt;STRONG&gt;Thread safe data binding with WPF&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;The data binding is as follows:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public ReadOnlyObservableCollection&amp;lt;string&amp;gt; StreetItems
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _streetItems; }
}
public ReadOnlyObservableCollection&amp;lt;string&amp;gt; RiverItems
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;get { return _riverItems; }
}&lt;/PRE&gt;&lt;P&gt;The code for filling the first combo box is as follows (the second combo box is filled accordingly):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var items = new ObservableCollection&amp;lt;string&amp;gt;();
_streetItems= new ReadOnlyObservableCollection&amp;lt;string&amp;gt;(items);
object lockObject = new object();
BindingOperations.EnableCollectionSynchronization(_streetItems, lockObject);
var codedValuePairs = await GetCodedValuePairsFromDomainAsync(layerName, fieldName);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;
lock (lockObject)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach (var keyValuePair in codedValuePairs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;items.Add(keyValuePair.Value);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}
}&amp;nbsp; &lt;/PRE&gt;&lt;P&gt;The problem is that I can only fill one combo box with the domain values. The other combo box (whether it is the first or the second) always remains empty.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788256#M1357</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2021-12-12T16:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788257#M1358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/356439" target="_blank"&gt;Barbara Schneider&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That thread safe data binding with that code example mention to use lock because it is running under the MCT thread&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FillCollectionAsync&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;

    QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&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="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// this is mct thread&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="comment token"&gt;// Reads and Writes should be made from within the lock&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;lock&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_lockObj&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
         _items&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetData&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="punctuation token"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//don't perform any UI update inside&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//you can update the variable but don't send notify property change command to UI to execute UI thread&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;//you can perform UI thread/ui update here inclsive of binded collection&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;/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;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;For your case seem to be outside of UI thread, so you might not need Lock keyword at all.&lt;/P&gt;&lt;P&gt;Additionally it could be simpler to use MVVM pattern done by ArcGIS pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For prowindows case you can achieve this by defining datacontext with vm&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="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;partial&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;sampleprowindow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; ArcGIS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Desktop&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Framework&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Controls&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ProWindow
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; sampleprowindowVm &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;sampleprowindowVm&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;// new class define&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;sampleprowindow&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="token function"&gt;InitializeComponent&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;//load the vm properties here&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DataContext &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Vm&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788257#M1358</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T09:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788258#M1359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Than Aung,&lt;/P&gt;&lt;P&gt;thank you for your reply! I already use the MVVM pattern using a ViewModel class. Yes, you are right, adding items to the combo box is not inside the MCT thread, so I removed the following code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;lock (lockObject)
{
&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt;&lt;P&gt;However, I need the following line of code because getting coded value pairs from domain is done inside the MCT thread:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;BindingOperations.EnableCollectionSynchronization(_streetItems, lockObject);&lt;/PRE&gt;&lt;P&gt;Otherwise, the combo box remains empty.&lt;/P&gt;&lt;P&gt;I still have the problem that I can only fill one combo box with the domain values. The other combo box (whether it is the first or the second) always remains empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788258#M1359</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2021-12-12T16:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788259#M1360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Barbara,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am assuming that when you debug your code the values in your 'codedValuePairs' variable for the second domain is empty?.&amp;nbsp; &amp;nbsp;What happens when you debug into your &lt;SPAN&gt;GetCodedValuePairsFromDomainAsync method.&amp;nbsp; Is the second domain found successfully?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;Can you post the code in this method.&amp;nbsp;&lt;/P&gt;&lt;PRE style="background-color: #ffffff; border: 0px;"&gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 00:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788259#M1360</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2020-07-23T00:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788260#M1361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/356439" target="_blank"&gt;Barbara Schneider&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got same situation like this before with MCT thread in MVVM binding,&lt;/P&gt;&lt;P&gt;We shall need to use temporary local variable and assign back to binding variable after the MCT thread will help you.&lt;/P&gt;&lt;P&gt;There is another way using await variable return the value and accept at the binding variable.&lt;/P&gt;&lt;P&gt;Below is the sample snippets of two solutions.&lt;/P&gt;&lt;P&gt;That how I normally solve,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used solution 1, If I need to rebind or notify UI update back with multiple properties/variable., if only one, I use solution 2.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//solution 1&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;BindingOperationAsync&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="keyword token"&gt;var&lt;/SPAN&gt; tmpBindingVariable &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;// or define the same type as binding variable&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&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="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// this is mct thread&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="comment token"&gt;//perform your mct operation &lt;/SPAN&gt;
tmpBindingVariable &lt;SPAN class="operator 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;&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; &lt;SPAN class="comment token"&gt;/// assign the result to tmpBindingVariable&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="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;bindingVariable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; tmpBindingvariable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;//solution 2&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;BindingOperationAsync&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="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;bindingVariable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&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="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// this is mct thread&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="comment token"&gt;//perform your mct operation &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//same type as this.bindingVariable&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="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;/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;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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788260#M1361</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T09:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788261#M1362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Narelle,&lt;/P&gt;&lt;P&gt;no, the values in my 'codedValuePairs' variable for the second domain are not empty. Yes, the second domain is found successfully. Please see below for the entire code I use.&lt;/P&gt;&lt;P&gt;Thanks, Barbara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 10:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788261#M1362</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2020-07-23T10:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788262#M1363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Than,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had already tried the solution with the temporary variable, but this doesn't work. I think that I already use the second solution, but I am not sure. Here is my code. There is probably something wrong with it:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; items &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;ObservableCollection&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;
_streetItems&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;ReadOnlyObservableCollection&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;items&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; lockObject &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;object&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;
BindingOperations&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;EnableCollectionSynchronization&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_streetItems&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lockObject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; codedValuePairs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetCodedValuePairsFromDomainAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;           
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; keyValuePair &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; codedValuePairs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  items&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;keyValuePair&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Value&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="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; Task&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;SortedList&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetCodeValuePairsFromDomainAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; featLayerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;                   
    Domain domain &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetDomainByFeatureLayerAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featLayerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    CodedValueDomain codedValueDomain &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CodedValueDomain&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;domain&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    SortedList&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; codedValuePairs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&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="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; codedValueDomain&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetCodedValuePairs&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="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="keyword token"&gt;return&lt;/SPAN&gt; codedValuePairs&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
   
&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; Task&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Domain&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetDomainByFeatureLayerAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; featLayerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;           
    Domain domain &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&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="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LayerUtils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetFeatureLayerByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featLayerName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featClass &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetFeatureClass&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="keyword token"&gt;var&lt;/SPAN&gt; featClassDef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featClass&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetDefinition&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="keyword token"&gt;int&lt;/SPAN&gt; index &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featClassDef&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindField&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featClassDef&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetFields&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;ElementAt&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Field&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;index&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetDomain&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="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="keyword token"&gt;return&lt;/SPAN&gt; domain&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;/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;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;/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;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;/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;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;I now use a workaround: I get the domain coded value pairs when the project starts and save them in global variables. I populate my combo boxes using these global variables later in the constructor of the ProWindow. This works.&lt;/P&gt;&lt;P&gt;Thanks, Barbara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788262#M1363</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2021-12-12T09:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788263#M1364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/356439"&gt;Barbara Schneider&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few comment on your code.&lt;/P&gt;&lt;P&gt;That items could be better if you declare at viewmodel, or class level (not method level), since you are planning to reuse in both comboboxes. Might be you have solved by this way.&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;var&lt;/SPAN&gt; items &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;new&lt;/SPAN&gt; &lt;SPAN class="" style="border: 0px; font-weight: inherit;"&gt;ObservableCollection&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;string&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to remove static keyword from your method. (Reason will be big discussion - would like to avoid that &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;, I add below microsoft doco)&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members#:~:text=Two%20common%20uses%20of%20static,be%20shared%20among%20all%20instances.&amp;amp;text=No%20object%20instance%20is%20required,are%20declared%20in%20method%20scope)."&gt;https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members#:~:text=Two%20common%20uses%20of%20static,be%20shared%20among%20all%20instances.&amp;amp;text=No%20object%20instance%20is%20required,are%20declared%20in%20method%20scope).&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 04:28:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788263#M1364</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-07-24T04:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: WPF: cannot fill more than one combo boxes with domain values</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788264#M1365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out what the problem is. In the constructor of my view model, I call the two functions to fill my combo boxes:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FillStreetComboboxAsync&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="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FillRiverComboboxAsync&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I remove the "await", my two combo boxes get filled.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;FillStreetComboboxAsync&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="token function"&gt;FillRiverComboboxAsync&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the method FillStreetComboboxAsync():&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FillStreetComboboxAsync&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="keyword token"&gt;var&lt;/SPAN&gt; items &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;ObservableCollection&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;
    _streetItems &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;ReadOnlyObservableCollection&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;items&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; lockObject &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;object&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; 
    BindingOperations&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;EnableCollectionSynchronization&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_streetItems &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lockObject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; codeValuePairs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetCodeValuePairsFromDomainAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_layerName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; _fieldName&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;     

    &lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; keyValuePair &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; codeValuePairs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        items&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;keyValuePair&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Value&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;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;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;Method fill RiverComboboxAsync() is analogous.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/wpf-cannot-fill-more-than-one-combo-boxes-with/m-p/788264#M1365</guid>
      <dc:creator>BarbaraSchneider2</dc:creator>
      <dc:date>2021-12-12T09:00:18Z</dc:date>
    </item>
  </channel>
</rss>

