Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 1 Mar 2007 11:53:38 -0000,    group: microsoft.public.windows.developer.winfx.avalon        back       


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
date: Thu, 1 Mar 2007 11:53:38 -0000   author:   Tim Mackey am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us