Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Don't you just hate it when that happens, not 5 minutes gone since I posted the question, and I've figured out what the problem is - and it <strong>was</strong> something quite basic. On the <code>CollectionViewSource</code> object, there is a <code>View</code> property, which has a <code>Refresh()</code> function. Calling this function after a property on an underlying item contained in the <code>ObservableCollection&lt;T&gt;</code> changes, seems to have done it.</p> <p>Basically, all I had to do was change the <code>CollectionViewSource</code> object into a member variable, and then save it when <code>LoadData()</code> is called:</p> <pre><code>private void MainPage_Loaded(object sender, RoutedEventArgs e) { if (!App.ViewModel.IsDataLoaded) { App.ViewModel.LoadData(); m_isSelectedListView = this.Resources["IsSelectedCollectionView"] as CollectionViewSource; if (m_isSelectedListView != null) { m_isSelectedListView.Source = App.ViewModel.Items; } } } </code></pre> <p>Then, call <code>Refresh()</code> on the view, after any of the items in the underlying <code>ObservableCollection&lt;T&gt;</code> changes. So in MainPage.xaml.cs, just after changing the last item, add the call to refresh:</p> <pre><code>private void ApplicationBarIconButton_Click(object sender, EventArgs e) { ItemViewModel item = App.ViewModel.Items[App.ViewModel.Items.Count - 1]; item.IsSelected = !item.IsSelected; m_isSelectedListView.View.Refresh(); } </code></pre> <p>... and the second Pivot's ListBox is updated instantly. Such a short line of code, a whole world of difference!</p> <p>In the time it took me to write up that question, there are a hundred things I could've done :-( Ah well, better late than never I guess - thought to post the answer here, if only to save someone else tearing out their hair like I did.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload