title: Why My MVVM does not work when I change data on the fly?
body: <p>My xaml:</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:TestMetroChartsVB"        
          xmlns:chart="clr-namespace:GravityApps.Mandelkow.MetroCharts;assembly=GravityApps.Mandelkow.MetroCharts"
          mc:Ignorable="d"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Window.DataContext&gt;
          &lt;local:TestPageViewModel/&gt;
      &lt;/Window.DataContext&gt;
      &lt;Grid&gt;
          &lt;StackPanel&gt;
              &lt;chart:ClusteredBarChart ChartTitle="Example1 " ChartSubTitle="Test1"&gt;
                  &lt;chart:ClusteredBarChart.Series&gt;
                      &lt;chart:ChartSeries SeriesTitle="Errors" ItemsSource="{Binding Errors}"
                                         DisplayMember="Category" ValueMember="Number"/&gt;
                  &lt;/chart:ClusteredBarChart.Series&gt;                    
              &lt;/chart:ClusteredBarChart&gt;
              &lt;Button x:Name="btnTest" Height="31" Margin="0,0,405,0" Content="Change Data"/&gt;
          &lt;/StackPanel&gt;    
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>My view:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Imports GravityApps.Mandelkow.MetroCharts Class MainWindow
  
  Private Sub btnTest_Click(sender As Object, e As RoutedEventArgs) Handles btnTest.Click
      Dim test As New TestPageViewModel
      test.changeData()
  End Sub End Class
  </code></pre>
  
  <p>My viewModel:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Imports System.Collections.ObjectModel
  
  Public Class TestPageViewModel
  
      Public Property Errors() As ObservableCollection(Of TestClass)
          Get
              Return m_Errors
          End Get
          Private Set
              m_Errors = Value
          End Set
      End Property
      Private m_Errors As ObservableCollection(Of TestClass)
      Public Sub New()
          Errors = New ObservableCollection(Of TestClass)
          Errors.Add(New TestClass("Data1", 5))
          Errors.Add(New TestClass("Data2", 10))
          Errors.Add(New TestClass("Data5", 15))
      End Sub
  
      Public Sub changeData()
          Errors.Clear()
          Errors.Add(New TestClass("DAta9", 10))
      End Sub
  
  End Class
  </code></pre>
  
  <p>My Model:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Class TestClass
      Public Property Category As String
          Get
              Return m_Category
          End Get
          Set(value As String)
              m_Category = value
          End Set
      End Property
      Private m_Category As String
      Public Property Number As Integer
          Get
              Return m_Number
          End Get
          Set(value As Integer)
              m_Number = value
          End Set
      End Property
      Private m_Number As Integer
  
      Public Sub New(category As String, number As Integer)
          Me.Category = category
          Me.Number = number
      End Sub End Class
  </code></pre>
  
  <p>It displays data initially like this:
  <a href="https://i.stack.imgur.com/UcPJd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UcPJd.jpg" alt="enter image description here"></a></p>
  
  <p>But when I click my "change data" button data does not change?
  What's the problem?</p>