Skip to content

Instantly share code, notes, and snippets.

@runceel
Created November 21, 2013 02:00
Show Gist options
  • Save runceel/7574866 to your computer and use it in GitHub Desktop.
Save runceel/7574866 to your computer and use it in GitHub Desktop.
using System;
using System.ComponentModel;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
var json = @"{""Name"": ""がりがりがりっち"" }";
var p = Newtonsoft.Json.JsonConvert.DeserializeObject<Person>(json);
Console.WriteLine(p.Name);
}
}
public class Person : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private string name;
public string Name
{
get { return name; }
set
{
name = value;
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Name"));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment