title: How to iterate an ObservableCollection of Dictionary in .Net Maui Page XML
body: <p>I have a data structure that comes from JSON:</p>
  <pre><code>{
  &quot;07-2022&quot;: [],
  &quot;08-2022&quot;: [
      {
          &quot;event_title&quot;: &quot;asdf&quot;
          &quot;positions&quot;: [
              {
                  &quot;position_title&quot;: &quot;Graphics Op&quot;
              },
              {
                  &quot;position_title&quot;: &quot;Graphic Design&quot;
              }
          ]
      }
  ],
  &quot;06-2023&quot;: []
  }
  </code></pre>
  <p>I have models for the Job and Position</p>
  <pre><code>public class OpenJob {
      // props...
      public List&lt;Position&gt; positions { get; set; }
  }
  </code></pre>
  <p>In my code I fetch the data and put it into a Dictionary</p>
  <pre><code>Dictionary&lt;string, List&lt;Models.OpenJob&gt;&gt; OpenJobList = new();
  
  public async Task&lt;Dictionary&lt;string, List&lt;Models.OpenJob&gt;&gt;&gt; getOpenJobs() {
          if (OpenJobList?.Count &gt; 0) {
              return OpenJobList;
          }
          var url = &quot;https://api.com&quot;;
          var response = await httpClient.GetAsync(url);
  
          if (response.IsSuccessStatusCode) {
              //Debug.WriteLine(response.ToString);
              OpenJobList = await response.Content.ReadFromJsonAsync&lt;Dictionary&lt;string, List&lt;Models.OpenJob&gt;&gt;&gt;();
          }
          return OpenJobList;
      }
  </code></pre>
  <p>Then In my ViewModel I transfer it to an ObservableCollection</p>
  <pre><code>//...
  public ObservableCollection&lt;Dictionary&lt;string, List&lt;OpenJob&gt;&gt;&gt; OpenJobsCollection { get; } = new();
  //...
  try {
      IsBusy = true;
      var openJobs = await jobsService.getOpenJobs();
      
      if (OpenJobsCollection.Count &gt; 0) {
          OpenJobsCollection.Clear();
      }
      OpenJobsCollection.Add(openJobs);
   }
  </code></pre>
  <p>Finally in my xml page I know how to iterate a simple List. But I can't find a solution for this data structure.</p>
  <pre><code>VerticalStackLayout&gt;
      &lt;CollectionView
          ItemsSource=&quot;{This Should be the Dictionary}&quot;
          SelectionMode=&quot;None&quot;&gt;
          &lt;CollectionView.ItemTemplate&gt;
              &lt;DataTemplate x:DataType=&quot;THIS SHOULD BE THE STRING KEY&quot;&gt;
                  &lt;Frame&gt;
                      &lt;CollectionView
                            ItemSource=&quot;{This should be the List of OpenJob Models}&quot; /&gt;
                            &lt;CollectionView.ItemTemplate&gt;
                                &lt;DataTemplate x:DataType=&quot;Models.OpenJob&quot;&gt;
                                    &lt;Label Text=&quot;{Binding event_title}&quot;/&gt;
                                &lt;/DataTemplate&gt;
                            &lt;/CollectionView.ItemTemplate&gt;
                      &lt;/CollectionView&gt;
                  &lt;/Frame&gt;
              &lt;/DataTemplate&gt;
          &lt;/CollectionView.ItemTemplate&gt;
          
       &lt;/CollectionView&gt;
      
      &lt;Button Text=&quot;Get Open Jobs&quot;
              Command=&quot;{Binding GetOpenJobsCommand}&quot;
              IsEnabled=&quot;{Binding IsNotBusy}&quot;
              /&gt;
      &lt;ActivityIndicator IsVisible=&quot;{Binding IsBusy}&quot;
                         IsRunning=&quot;{Binding IsBusy}&quot;
                         HorizontalOptions=&quot;FillAndExpand&quot;
                         VerticalOptions=&quot;CenterAndExpand&quot;
                         /&gt;
  &lt;/VerticalStackLayout&gt;
  </code></pre>