Skip to content

Instantly share code, notes, and snippets.

@runegri
Created January 27, 2012 21:06
Show Gist options
  • Save runegri/1690917 to your computer and use it in GitHub Desktop.
Save runegri/1690917 to your computer and use it in GitHub Desktop.
How to use XamlWriter and XamlReader
class Program
{
static void Main(string[] args)
{
var test = new Test {Name = "Rune", Number = 35};
var serialized = XamlWriter.Save(test);
var deserialized = (Test) XamlReader.Parse(serialized);
}
}
public class Test
{
public string Name { get; set; }
public int Number { get; set; }
}
@mythz
Copy link

mythz commented Jan 27, 2012

XamlWriter.Save() and XamlReader.Parse() doesn't exist for me? which assembly did you get it from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment