Restore raddocking configuration

6 posts, 0 answers
  1. xavendano
    xavendano avatar
    35 posts
    Member since:
    Feb 2012

    Posted 02 Aug 2012 Link to this post

    Is it possible to restore the original configuration of a RadDocking through code behind (panels, windows shrink, etc) after the user has "played" and changed the location and properties of these objects?

    Ie set through code how the window was originally.

    thanks
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 02 Aug 2012 Link to this post

    Hi Xavendano,

    Yes, you can save the layout of your RadDocking and load it programmatically. This link will bring you to the documentation and a tutorial on how to Save/Load the layout. In your case I would have a preexisting layout already saved and name it "DefaultLayout". That way you can load it whenever you see fit.

    You can also save and load the content of the RadPanes. This link will explain how to do that.

    Good luck,
    Lancelot
  3. UI for WPF is Visual Studio 2017 Ready
  4. xavendano
    xavendano avatar
    35 posts
    Member since:
    Feb 2012

    Posted 10 Aug 2012 Link to this post

    Hi Master Lancelot,

    I follow your indications but when I try to run the code (converted to VB with its own converter) I have the following error: (See image)

    What can I do to fix this.....???

    Framework 3.5

    Thanks.....


  5. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 10 Aug 2012 Link to this post

    Hi Xavendando,

    Try storage.Open instead. Here is the MSDN documentation for System.IO. (make sure you have Version 3.5 selected at the top)

    Good luck,
    Lancelot
  6. xavendano
    xavendano avatar
    35 posts
    Member since:
    Feb 2012

    Posted 10 Aug 2012 Link to this post

    Hi Lancelot,

    Yep...

    I tried that but not working.
    The Microsoft documentation is correct for the System.IO

    But is being applied on the object type IsolatedStorageFile sincerely had not used before, and this type of object that method (Open or OpenFile) does not exist.

    Thanks
  7. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 10 Aug 2012 Link to this post

    I just noticed you are using IsolatedStorage... IsolatedStorage is a Silverlight only interface. see this MSDN thread. That is why OpenFile is not available to you in the way you're using it.

    This example demonstrates how to do it in WPF

    protected override void OnStartup(StartupEventArgs e)
            {
                try
                {
                    //First get the 'user-scoped' storage information location reference in the assembly
                    IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForAssembly();
                    //create a stream reader object to read content from the created isolated location
                    StreamReader srReader = new StreamReader(new IsolatedStorageFileStream("isotest", FileMode.OpenOrCreate, isolatedStorage));
     
                    //Open the isolated storage
                    if (srReader == null)
                    {
                        MessageBox.Show("No Data stored!");
                    }
                    else
                    {
                        //MessageBox.Show(stateReader.ReadLine());
                        while (!srReader.EndOfStream)
                        {
                            string item = srReader.ReadLine();
                            MessageBox.Show(item);
                        }
                    }
                    //close reader
                    srReader.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    throw;
                }
            }


    Good Luck,
    Lancelot
Back to Top
UI for WPF is Visual Studio 2017 Ready