UWP Gridview Binding to ObservableCollection and clearing values
<p>so I am creating a GridView in a UWP app which is bound to an ObservableCollection. </p>

<p>XAML:</p>

<pre><code>&lt;Page.Resources&gt;
    &lt;CollectionViewSource
            x:Name="ListSource"
            Source="{x:Bind model.ShowList}"
            IsSourceGrouped="false"
            /&gt;
&lt;/Page.Resources&gt;
...
&lt;Page&gt;
    &lt;GridView x:Name="lvListSource" ItemsSource="{Binding Source={StaticResource ListSource}}" SelectedIndex="-1" Grid.Row="2" HorizontalContentAlignment="Center" SelectionChanged="lvEpisodeListSource_SelectionChanged"&gt;
                &lt;GridView.ItemTemplate&gt;
                    &lt;DataTemplate x:DataType="local:PageInput"&gt;
                        &lt;TextBlock Name="AlbumBlock" Foreground="Black" FontWeight="Normal" FontSize="15" Margin="5,0,5,0"
                                    Text="{x:Bind Name}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100"/&gt;
                    &lt;/DataTemplate&gt;
                &lt;/GridView.ItemTemplate&gt;
            &lt;/GridView&gt;
&lt;/page&gt;
</code></pre>

<p>C#:</p>

<pre><code>public MainCategoryModel model;
public MainPage()
{
    model = new MainCategoryModel();
    this.InitializeComponent();
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    //initialize model data in code and stuff comes out correctly
    //model.Clear() give unknown error here
    model.Add(new PageInput() {...});
    lvListSource.ItemsSource = model.myList;
}

public class MainCategoryModel
{
    public ObservableCollection&lt;PageInput&gt; myList { get; set; }

    public MainCategoryModel()
    {
        myList = new ObservableCollection&lt;PageInput&gt;();
    }

    public void AddShow(PageInput show)
    {
        myList.Insert(0, show);
    }

    public void Clear()
    {
        myList.Clear();
    }
}
</code></pre>

<p>The ObservableCollection initializes properly and the page loads perfectly fine when I only add items to the collection. The problem is, I would like to update this ObservableCollection the GridView is bound to every time the OnNavigatedTo function is called. This includes removing items from the collection. Every time I either remove items or try to Clear the ObservableCollection the page fails to load with an unknown error. Is there a way to modify and remove values from an Observable Collection that is already bound to?</p>

<p>As a side problem, If I don't re-set the ItemsSource property at the end of OnNavigatedTo, the SelectionChanged event is called immediately after adding values to the Collection since it is set in XAML. Is there a way to have the SelectionChanged event not call when items are added to a GridView?</p>