In some circumstances a RadPaneGroup will not show content using a loaded layout. Can reproduce with controls version 2011.2.1010.1040 and 2011.3.1020.1040.
To reproduce:
- Dock the second pane on the right side of the split container (see docking_layout.png)
- Save the layout
- Refresh the application
- Load the layout
- Make the second pane hidden
- Make the second pane visible (see docking_problem.png)
Example XAML:
Example CS:
using
System.ComponentModel;
using
System.IO;
using
System.Windows;
using
System.Windows.Controls;
using
Telerik.Windows.Controls;
namespace
DockingPersistence
{
public
partial
class
MainPage : UserControl, INotifyPropertyChanged
{
public
MainPage()
{
InitializeComponent();
DataContext =
this
;
}
private
bool
_firstPaneIsHidden;
public
bool
FirstPaneIsHidden
{
get
{
return
_firstPaneIsHidden; }
set
{ _firstPaneIsHidden = value; NotifyPropertyChanged(
"FirstPaneIsHidden"
); }
}
private
bool
_secondPaneIsHidden;
public
bool
SecondPaneIsHidden
{
get
{
return
_secondPaneIsHidden; }
set
{ _secondPaneIsHidden = value; NotifyPropertyChanged(
"SecondPaneIsHidden"
); }
}
private
void
Save_Click(
object
sender, RoutedEventArgs e)
{
SaveFileDialog dialog =
new
SaveFileDialog();
if
(dialog.ShowDialog() ==
true
)
{
using
(Stream stream = dialog.OpenFile())
{
Dock.SaveLayout(stream);
}
}
}
private
void
Load_Click(
object
sender, RoutedEventArgs e)
{
OpenFileDialog dialog =
new
OpenFileDialog();
if
(dialog.ShowDialog() ==
true
)
{
using
(Stream stream = dialog.File.OpenRead())
{
Dock.LoadLayout(stream);
}
}
}
public
event
PropertyChangedEventHandler PropertyChanged;
private
void
NotifyPropertyChanged(
string
property)
{
if
(PropertyChanged !=
null
)
{
PropertyChanged(
this
,
new
PropertyChangedEventArgs(property));
}
}
}
}