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
Ie set through code how the window was originally.
thanks
5 Answers, 1 is accepted
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
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
0
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
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
Good Luck,
Lancelot
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