title: ListView item foreground color with binding
body: <p>I have a listview with data template as below :</p>
  
  <pre><code>&lt;ListView x:Name="errorListBox" Width="615" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="White" Grid.Row="1" ItemsSource="{x:Bind Errors}"&gt;
      &lt;ListView.ItemTemplate&gt;
         &lt;DataTemplate&gt;
          &lt;StackPanel Orientation="Vertical"&gt;
            &lt;TextBlock TextAlignment="Left" Foreground="Red" TextWrapping="Wrap" Text="{Binding}" /&gt;
          &lt;/StackPanel&gt;
         &lt;/DataTemplate&gt;
       &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>I want to set different color for different TextBlock in it. Currently the foreground is set to "Red".</p>
  
  <p>How can we bind the Foreground color with some property in uwp c++?</p>
  
  <p>The Working c++ code following the accepted answer. This can be helpful for someone :</p>
  
  <pre><code>public ref class Error sealed
  {
  private:
      Platform::String^ m_error;
      Windows::UI::Xaml::Media::SolidColorBrush^ m_foreGround;
  
  public:
      Error(Platform::String^ error, Windows::UI::Xaml::Media::SolidColorBrush^ colorBrush)
      {
          m_error = error;
          m_foreGround = colorBrush;
      }
  
      property Platform::String^ ErrorText
      {
          Platform::String^ get()
          {
              return m_error;
          }
  
          void set(Platform::String^ val)
          {
              m_error = val;
          }
      }
  
      property Windows::UI::Xaml::Media::SolidColorBrush^ Foreground
      {
          Windows::UI::Xaml::Media::SolidColorBrush^ get()
          {
              return m_foreGround;
          }
          void set(Windows::UI::Xaml::Media::SolidColorBrush^ brush)
          {
              m_foreGround = brush;
          }
      }
  
  };
  </code></pre>