PFA a sample which will illustrate the problem.
I am seeing a very strange behavior while setting the ishidden property through code. Run the pasted code as it is, you will see the problem.
This problem arrises when the IsHidden property is initially set to true.
MainPage.xaml
<UserControl x:Class="RadDockingIsHidden.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerikdocking="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<telerikdocking:RadDocking x:Name="rootDocking" AllowUnsafeMode="True"
Padding="0" Margin="0" BorderThickness="0 1 0 0"
HasDocumentHost="False">
<telerikdocking:RadSplitContainer
x:Name="splitContainer1"
InitialPosition="DockedRight"
Orientation="Horizontal">
<telerikdocking:RadPaneGroup >
<telerikdocking:RadPane x:Name="paneLeft" Header="Left"
ContextMenuTemplate="{x:Null}"
Padding="0" CanUserClose="False" CanFloat="False" CanUserPin="False">
<Button Content="Left" Click="Button_Click" />
</telerikdocking:RadPane>
</telerikdocking:RadPaneGroup>
<telerikdocking:RadPaneGroup x:Name="previewPaneGroup"
>
<telerikdocking:RadPane x:Name="rightPane" Foreground="White"
IsHidden="{Binding IsRightHidden, Mode=TwoWay}"
Header="Preview"
CanUserClose="True" CanFloat="False" CanUserPin="False"
ContextMenuTemplate="{x:Null}"
>
<Button Content="Right" />
</telerikdocking:RadPane>
</telerikdocking:RadPaneGroup>
</telerikdocking:RadSplitContainer>
</telerikdocking:RadDocking>
</Grid>
</UserControl>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace RadDockingIsHidden
{
public partial class MainPage : UserControl, INotifyPropertyChanged
{
public MainPage()
{
Loaded += new RoutedEventHandler(ResultsPane_Loaded);
}
//RightViewModel vm = new RightViewModel();
void ResultsPane_Loaded(object sender, RoutedEventArgs e)
{
InitializeComponent();
DataContext = this;
IsRightHidden = true;
}
private bool isRightHidden;
public bool IsRightHidden
{
get
{
return isRightHidden;
}
set
{
isRightHidden = value;
RaisePropertyChanged("IsRightHidden");
}
}
public void RaisePropertyChanged(string propName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
private void Button_Click(object sender, RoutedEventArgs e)
{
IsRightHidden = !IsRightHidden;
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
I am seeing a very strange behavior while setting the ishidden property through code. Run the pasted code as it is, you will see the problem.
This problem arrises when the IsHidden property is initially set to true.
MainPage.xaml
<UserControl x:Class="RadDockingIsHidden.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerikdocking="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<telerikdocking:RadDocking x:Name="rootDocking" AllowUnsafeMode="True"
Padding="0" Margin="0" BorderThickness="0 1 0 0"
HasDocumentHost="False">
<telerikdocking:RadSplitContainer
x:Name="splitContainer1"
InitialPosition="DockedRight"
Orientation="Horizontal">
<telerikdocking:RadPaneGroup >
<telerikdocking:RadPane x:Name="paneLeft" Header="Left"
ContextMenuTemplate="{x:Null}"
Padding="0" CanUserClose="False" CanFloat="False" CanUserPin="False">
<Button Content="Left" Click="Button_Click" />
</telerikdocking:RadPane>
</telerikdocking:RadPaneGroup>
<telerikdocking:RadPaneGroup x:Name="previewPaneGroup"
>
<telerikdocking:RadPane x:Name="rightPane" Foreground="White"
IsHidden="{Binding IsRightHidden, Mode=TwoWay}"
Header="Preview"
CanUserClose="True" CanFloat="False" CanUserPin="False"
ContextMenuTemplate="{x:Null}"
>
<Button Content="Right" />
</telerikdocking:RadPane>
</telerikdocking:RadPaneGroup>
</telerikdocking:RadSplitContainer>
</telerikdocking:RadDocking>
</Grid>
</UserControl>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace RadDockingIsHidden
{
public partial class MainPage : UserControl, INotifyPropertyChanged
{
public MainPage()
{
Loaded += new RoutedEventHandler(ResultsPane_Loaded);
}
//RightViewModel vm = new RightViewModel();
void ResultsPane_Loaded(object sender, RoutedEventArgs e)
{
InitializeComponent();
DataContext = this;
IsRightHidden = true;
}
private bool isRightHidden;
public bool IsRightHidden
{
get
{
return isRightHidden;
}
set
{
isRightHidden = value;
RaisePropertyChanged("IsRightHidden");
}
}
public void RaisePropertyChanged(string propName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
private void Button_Click(object sender, RoutedEventArgs e)
{
IsRightHidden = !IsRightHidden;
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
----- Steps to get the issue
1. Run the code
2. Click the left button to open the right pane.
3. Again click the left button to close the right pane
4. Again click the left button to open the right pane..
5. You see that the entire binding of the right pane is lost.
Is this a known issue ?
1. Run the code
2. Click the left button to open the right pane.
3. Again click the left button to close the right pane
4. Again click the left button to open the right pane..
5. You see that the entire binding of the right pane is lost.
Is this a known issue ?