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 - IAddChild and XAML serialization process ??

 
 
Old 12-05-2006   #1 (permalink)
azerty


 
 

IAddChild and XAML serialization process ??

Hello

I try to use xaml serializer framework to save in .xaml file my own
hierarchical graph of object.

The first step is done : I create my own file with something like this :

<Root
xmlns="clr-namespace:myNameSpace;assembly=MyAssembly">
<Structure ...>
<SimpleText ... />
</Structure>
</Root>

with a simple call like this :

outStream = new System.IO.FileStream(@"c:\temp\essai.xaml",
System.IO.FileMode.Create);
using (outStream)
{
System.Windows.Markup.XamlWriter.Save(rootInstance,
outStream);
}

BUT when I want to reverse the process (Create a RootInstance from xaml
file) with a call like this :

System.IO.FileStream inStream = new
System.IO.FileStream(@"c:\temp\essai.xaml",
System.IO.FileMode.Open);
using (inStream)
{
return
(Root)System.Windows.Markup.XamlReader.Load(inStream);
}

Root is created
Structure is created
SimpleText is created
BUT i have after this, an exception like "SimpleText can be added in
Structure" occurs !!

Structure and Root supports IEnumerable and IAddChild interface !!

I don't know what I forgot somewhere ????

could you help me

thanks a lot for your help !



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Is it possible to include XAML files into another XAML file? .NET General


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