Created
November 21, 2013 02:00
-
-
Save runceel/7574866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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