This is a migrated thread and some comments may be shown as answers.

Restore raddocking configuration

5 Answers 103 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Romell
Top achievements
Rank 1
Romell asked on 02 Aug 2012, 02:02 PM
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

5 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 02 Aug 2012, 04:26 PM
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
0
Romell
Top achievements
Rank 1
answered on 10 Aug 2012, 09:08 PM
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.....


0
Lancelot
Top achievements
Rank 1
answered on 10 Aug 2012, 09:14 PM
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
0
Romell
Top achievements
Rank 1
answered on 10 Aug 2012, 09:19 PM
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
0
Lancelot
Top achievements
Rank 1
answered on 10 Aug 2012, 09:27 PM
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
Tags
Docking
Asked by
Romell
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Romell
Top achievements
Rank 1
Share this question
or