Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3806
Error on LoadLayout: Root element is missing
posted

I have simple requirement to save layout to file on Close and load the layout when opened. But I am getting error on LoadLayout: root element is missing.

I tried doing into a simple sample and getting the same issue. I have TilesControl (contains 2 tiles) and 2 button to Save & Load layouts.

MemoryStream m = new MemoryStream();
private void Save_Click(object sender, RoutedEventArgs e)
        {
            TilesControl.SaveLayout(m);
        }
private void Load_Click(object sender, RoutedEventArgs e)
        {
            TilesControl.LoadLayout(m);
       //ERROR: Root element is missing.
       }
Please help on this. 
Parents
No Data
Reply
  • 350
    Suggested Answer
    posted

    Hi,

    I will suggest you to change the position of the MemoryStream object to the begining before you try to load the layout:

    m.Position = 0;

    TilesControl.LoadLayout(m);

    Hope that this will help.

     

     

     

Children
No Data