Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

can't serialize ViewPort3d child elements...

Closed Thread
 
Thread Tools Display Modes
Old 03-01-2007   #1 (permalink)
Tim Mackey
Guest


 

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

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't delete elements in folder Recent elements Gudmund Liebach Nielsen Vista General 1 05-05-2008 07:17 PM
Support for Adobe photoshop elements 5 or premier elements 3 on Vista 64 bits Sébastien DELAYRE Vista General 5 03-26-2007 09:57 AM
Viewport3D in XPS Alex74 Avalon 2 01-26-2007 01:36 PM








Vistax64.com 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 2005-2008

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 47 48 49 50