3

I have a bunch of WPF controls that needs to be dumped to xaml. Some controls contain non-serializable objects stored in their's Tag property. I need to ignore them during saving Xaml, since I need layout itself, but XamlWriter.Save generates an error that states that they are not serializable.

kaya3
  • 47,440
  • 4
  • 68
  • 97
LOST
  • 2,956
  • 3
  • 25
  • 40

1 Answers1

5

To ignore a property add

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Check out this article: http://blogs.msdn.com/b/mikehillberg/archive/2006/09/16/xamlwriter.aspx

pr0gg3r
  • 4,254
  • 1
  • 36
  • 27