title: Entry controls in a CollectionView aren't updating the source they're bound to (Xamarin.Forms, UWP)
body: <p>I'm creating an educational app for learning terminology... using UWP via Xamarin.Forms for the data entry. This view is for creating lists of terms and saving them to my database. In this case, we're making a list for bones of the body. Here's what it looks like:</p>
  <p><a href="https://i.stack.imgur.com/UOuNE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UOuNE.jpg" alt="My view after pressing &quot;Add New Item(s)&quot;" /></a></p>
  <p>Pretty simple UI. Every time I click &quot;Add New Item(s)&quot; it creates a &quot;&lt;*New Item*&gt;&quot; <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/entry" rel="nofollow noreferrer">Entry</a> at the top of my <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/collectionview/introduction" rel="nofollow noreferrer">CollectionView</a>. I overwrite &quot;&lt;*New Item*&gt;&quot; with the word I want, and then click the &quot;Save&quot; button.</p>
  <p>The &quot;Add New Item(s)&quot; button works like a champ, but the &quot;Save&quot; button is sick. After clicking &quot;Save&quot; the first time, it sends the list to my json database just fine. When I inspect the database I see &quot;&lt;*New Item*&gt;&quot; along with the rest of the list, like so:</p>
  <pre><code>  &quot;name&quot;: &quot;Bones of the Body, Common&quot;,
    &quot;choiceFormat&quot;: &quot;6x1&quot;,
    &quot;items&quot;: [
      &quot;&lt;*New Item*&gt;&quot;,
      &quot;Ankle Bone&quot;,
      &quot;Arm Bone&quot;,
      &quot;Breastbone&quot;,
      &quot;Cheek Bone&quot;,
      &quot;Collarbone&quot;,
      &quot;Forearm Bone (Large)&quot;,
      &quot;Forearm Bone (Small)&quot;,
      &quot;Hammer&quot;,
      &quot;Hard Palate (back)&quot;,
      &quot;Heel Bone&quot;,
      &quot;Hip Bone&quot;,
      &quot;Knee Cap&quot;,
      &quot;Leg Bone (Large)&quot;,
      &quot;Leg Bone (Small)&quot;,
      &quot;Lower Jaw&quot;,
      &quot;Rib&quot;,
      &quot;Rib Cage&quot;,
      &quot;Shoulder Blade&quot;,
      &quot;Spine&quot;,
      &quot;Stirrup&quot;,
      &quot;Tailbone&quot;,
      &quot;Thigh Bone&quot;,
      &quot;Tongue Bone&quot;,
      &quot;Upper Jaw&quot;
    ],
    &quot;spellable&quot;: true
  </code></pre>
  <p>Now in my UI, I click into the top Entry for &quot;&lt;*New Item*&gt;&quot; and rename it to &quot;Anvil&quot; like so...</p>
  <p><a href="https://i.stack.imgur.com/wYnEl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYnEl.jpg" alt="My view after renaming to &quot;Anvil&quot;" /></a></p>
  <p>Then when I click save, the database list stays the same... it still says &quot;&lt;*New Item*&gt;&quot; and not &quot;Anvil&quot;.</p>
  <p>So I dropped a breakpoint in the save function and the debugger's telling me that here's where the issue is... the ObservableCollection that's the source for my CollectionView (named OCItems) doesn't say &quot;Anvil&quot;, it's stuck on &quot;&lt;*New Item*&gt;&quot;. (The location of the breakpoint is noted in my ViewModel code below.)</p>
  <p><a href="https://i.stack.imgur.com/zgDuX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zgDuX.jpg" alt="Debugger watch showing that the Observable Collection doesn't say Anvil like it should" /></a></p>
  <p>My other controls (Choice Format and Spellable) bind, update, and save to the database just fine. What's going on with the Entry controls in my CollectionView? Why don't they update when I replace the text in them? Note that both {Binding}s are TwoWay.</p>
  <p>Here's the relevant code:</p>
  <p>XAML</p>
  <pre><code>...
  &lt;Button Text=&quot;Add New Item(s)&quot; Grid.Row=&quot;2&quot; Grid.Column=&quot;0&quot; Command=&quot;{Binding AddItemSlot}&quot; /&gt;&lt;Button Text=&quot;Save&quot; Grid.Row=&quot;2&quot; Grid.Column=&quot;2&quot; Command=&quot;{Binding SaveAnswerSet}&quot; /&gt;
  &lt;CollectionView x:Name=&quot;MyCollectionView&quot; Grid.Row=&quot;3&quot; Grid.Column=&quot;0&quot; Grid.ColumnSpan=&quot;3&quot; ItemsSource=&quot;{Binding OCItems, Mode=TwoWay}&quot; &gt;
      &lt;CollectionView.ItemTemplate&gt;
          &lt;DataTemplate x:DataType=&quot;x:String&quot;&gt;
              &lt;Entry Text=&quot;{Binding Mode=TwoWay}&quot; /&gt;
          &lt;/DataTemplate&gt;
      &lt;/CollectionView.ItemTemplate&gt;
  &lt;/CollectionView&gt;
  ...
  </code></pre>
  <p>ViewModel</p>
  <pre><code>...
  public ObservableCollection&lt;string&gt; OCItems { get; set; }
  public ICommand AddItemSlot { get; set; }
  public ICommand SaveAnswerSet { get; set; }
  ...
  
  ...
  // (in constuctor)
  AddItemSlot = new Command(() =&gt;
  {
      OCItems.Insert(0, &quot;&lt;*New Item*&gt;&quot;);
  });
  
  SaveAnswerSet = new Command(() =&gt;
  {
      App.Database.Save(OCItems);   // BREAKPOINT
  });
  ...
  </code></pre>
  <p>Thanks for your consideration.</p>
  <p>Kind regards,
  David</p>