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:
Example CS:
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:
<
UserControl
x:Class
=
"DockingPersistence.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"30"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Button
Content
=
"Save Layout"
Click
=
"Save_Click"
/>
<
Button
Content
=
"Load Layout"
Click
=
"Load_Click"
/>
<
CheckBox
IsChecked
=
"{Binding FirstPaneIsHidden, Mode=TwoWay}"
Content
=
"First pane IsHidden"
/>
<
CheckBox
IsChecked
=
"{Binding SecondPaneIsHidden, Mode=TwoWay}"
Content
=
"Second pane IsHidden"
/>
</
StackPanel
>
<
telerik:RadDocking
x:Name
=
"Dock"
Grid.Row
=
"2"
>
<
telerik:RadSplitContainer
telerik:RadDocking.SerializationTag
=
"DefaultContainer"
InitialPosition
=
"DockedBottom"
>
<
telerik:RadPaneGroup
x:Name
=
"DefaultGroup"
telerik:RadDocking.SerializationTag
=
"DefaultGroup"
>
<
telerik:RadPane
Title
=
"First"
IsHidden
=
"{Binding FirstPaneIsHidden, Mode=TwoWay}"
telerik:RadDocking.SerializationTag
=
"FirstPane"
>
This is the FIRST pane.
</
telerik:RadPane
>
<
telerik:RadPane
Title
=
"Second"
IsHidden
=
"{Binding SecondPaneIsHidden, Mode=TwoWay}"
telerik:RadDocking.SerializationTag
=
"SecondPane"
>
This is the SECOND pane.
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Grid
>
</
UserControl
>
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));
}
}
}
}