Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - can't serialize ViewPort3d child elements...

 
 
Old 03-01-2007   #1 (permalink)
Tim Mackey


 
 

can't serialize ViewPort3d child elements...

hi,
i have a 3d-land thing going, and i want to serialize all the objects in the
scene with XamlWriter. the objects are added as children of a ViewPort3D.
i tried serializing ViewPort3D.Children which is a Visual3DCollection but
this can't be deserialized because it has no default constructor (the
XamlReader barfs with a XamlParseException).

so instead i tried serializing eaech of the child elements individually,
like so:

using (StreamWriter sw = File.CreateText(d.SafeFileName))
foreach(Visual3D v in this.mainViewport.Children)
XamlWriter.Save(v, sw);

and this saves it alright, but it won't deserialize because "there are
multiple root elements". i tried manually adding an <xml> root element but
it got very messy to deserialise.

what is the correct approach? i don't really want to serialize out the
entire window contents, because the code behind will change with new menus /
options etc., and i will want to be able to use old xaml files from a
previous version.

thanks in advance
tim


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Can't delete elements in folder Recent elements Vista General
Support for Adobe photoshop elements 5 or premier elements 3 on Vista 64 bits Vista General
Serialize WordPad OLE data to a file? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46