title: Loading Json data to WPF
body: <p>I'm trying to load Json file into my  wpf project but it's not working..
  Can you help me please? I watched many videos and still didn't find the right solution</p>
  
  <p>After ruining program is throwin an exception "Error converting value "{" to type 'Test.MyLibrary', Path", line 3, position 1 </p>
  
  <p>This is my Json file "test.json".</p>
  
  <pre><code>{
                      "Name" : "Apple",  
  
                      "ExpiryDate" : "May",
  
                      "Price" : 3.99
  
                      }
  </code></pre>
  
  <p>This is my class MyLibrary</p>
  
  <pre><code> class MyLibrary
  {
  
  
          public string Name { get; set; }
          public string ExpiryDate { get; set; }
          public double Price { get; set; }
  
  }
  </code></pre>
  
  <p>My C# code</p>
  
  <pre><code>public MainWindow()
      {
  
          string path = "test.json";
          String myStream= File.ReadAllText(path);
          InitializeComponent();
  
  
          try
  
          {
  
              MyLibrary myLibrary= JsonConvert.DeserializeObject&lt;MyLibrary&gt;(myStream.ToString());
  
              DataContext = myLibrary;
  
          }
  
          catch (Exception ex)
  
          {
  
  
              MessageBox.Show(ex.Message);
  
          }
  </code></pre>
  
  <p>And now i want to show Name in WPF label</p>
  
  <pre><code>&lt;Window x:Class="Test.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:Test"
      mc:Ignorable="d"
      Title="MainWindow" Height="450" Width="800"&gt;
  &lt;Window.DataContext&gt;
      &lt;local:MyLibrary/&gt;
  &lt;/Window.DataContext&gt;
  &lt;Grid&gt;
      &lt;StackPanel&gt;
          &lt;TextBox x:Name="firstLabel" Text="{Binding Path=Name}"&gt;&lt;/TextBox&gt;
          &lt;Label Content="{Binding Path=Price}"&gt;&lt;/Label&gt;
  
      &lt;/StackPanel&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>What i'm doing wrong ? Any ideas?</p>