Note that there are some explanatory texts on larger screens.

plurals
  1. POxml Parse Exception error when deserializing WPF
    primarykey
    data
    text
    <p>I am having problems deserializing a xaml file and get the following error </p> <p><img src="https://i.stack.imgur.com/O0WsK.png" alt="enter image description here"></p> <p>My code is as follows:</p> <pre><code> private void SerializeToXML() { FileStream filestream = File.Create(@"H:\test1.xaml"); StreamWriter streamwriter = new StreamWriter(filestream); foreach (ListViewItem Item in slideListView.Items) { string mystrXAMLWrite = XamlWriter.Save(Item.Tag); streamwriter.Write(mystrXAMLWrite); } streamwriter.Close(); filestream.Close(); } private void DeSerialize() { FileStream filestream = File.Open(@"H:\test1.xaml", FileMode.Open); XamlReader reader = new XamlReader(); slideListView = (ListView)reader.LoadAsync(filestream); } </code></pre> <p>If I go to the XAML file after saving and change the various names it has problems with, for example changing slideCanvas to slideCanvas1 and ContextMenu to ContextMenu1, then it will load. But obviously this is not a solution and it also means that whatever is loaded back in is not pointing to the correct bits of code as they have had numbers added to the values.</p> <p>Does anyone know what I need to do here?</p> <p>UPDATED</p> <p>Here is the xaml produced when saving one slide object</p> <pre><code>&lt;Slide imageZIndex="0" editText="False" ClipToBounds="True" xmlns="clr-namespace:StoryboardTool;assembly=StoryboardTool" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;&lt;av:Canvas Background="#FFFFFFFF" Name="slideCanvas" /&gt;&lt;/Slide&gt; </code></pre> <p>If I try to place this in a Slide Object for example</p> <pre><code>Var obj = (Slide)reader.LoadAsync(filestream); </code></pre> <p>I get this XmalParseExceptionOccured problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload