Hello,
The problem occurs when you have a floating panel
I modified your sample to reproduce the issue
Take a look on :
<
UserControl
x:Class
=
"Docking_TEST_SL.MainPage"
mc:Ignorable
=
"d"
xmlns:alf
=
"clr-namespace:Core.Converters"
xmlns:local
=
"clr-namespace:Docking_TEST_SL"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
<
UserControl.Resources
>
<
local:ViewModel
x:Key
=
"MyViewModel"
/>
<
alf:BooleanToVisibilityConverter
x:Name
=
"btoV"
/>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
Grid.Resources
>
</
Grid.Resources
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
>
<
telerik:RadRadioButton
x:Name
=
"_btnAdmin"
Content
=
"click to change"
IsChecked
=
"False"
GroupName
=
"grp"
/>
<
telerik:RadRadioButton
Content
=
"click to change"
GroupName
=
"grp"
/>
</
StackPanel
>
<
telerik:RadDocking
VerticalAlignment
=
"Stretch"
x:Name
=
"Docking"
Background
=
"{x:Null}"
Grid.Row
=
"1"
BorderBrush
=
"{x:Null}"
Foreground
=
"{x:Null}"
Margin
=
"0,0,0,0"
HasDocumentHost
=
"False"
>
<
telerik:RadSplitContainer
InitialPosition
=
"DockedRight"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Header
=
"Pane 1"
CanUserClose
=
"False"
CanFloat
=
"False"
CanUserPin
=
"False"
CanDockInDocumentHost
=
"False"
>
<
Button
x:Name
=
"button"
Visibility
=
"{Binding IsChecked}"
/>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<!--HERE if you change on "DockedRight" it works !-->
<
telerik:RadSplitContainer
InitialPosition
=
"FloatingDockable"
telerik:RadDocking.FloatingSize
=
"200,400"
telerik:RadDocking.FloatingLocation
=
"50,100"
telerik:DockingPanel.InitialSize
=
"200,600"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
CanUserClose
=
"False"
CanFloat
=
"True"
CanUserPin
=
"True"
CanDockInDocumentHost
=
"False"
Header
=
"Pane 3"
>
<
TextBlock
Text
=
"Binded to _btnAdmin"
Visibility
=
"{Binding IsChecked, Converter={StaticResource btoV}, ElementName=_btnAdmin}"
/>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Grid
>
</
UserControl
>
using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;
using System.Collections;
namespace Core.Converters
{
internal static class VisibilityHelper
{
public static string INVERTER_PARAMETER = "Invert";
public static Visibility BoolToVisibility(object toConvert, object parameter)
{
bool boolValue = false;
if (toConvert is bool)
boolValue = (bool)toConvert;
else if (toConvert is bool?)
{
var t_value = toConvert as bool?;
if (t_value.HasValue)
boolValue = t_value.Value;
}
//else
// boolValue = ConvertHelper.ToBool(toConvert);
if ((parameter != null) && (parameter.ToString() == VisibilityHelper.INVERTER_PARAMETER))
boolValue = !boolValue;
return boolValue ? Visibility.Visible : Visibility.Collapsed;
}
public static bool VisibilityToBool(object toConvert, object parameter)
{
if ((parameter != null) && (parameter.ToString() == INVERTER_PARAMETER))
{
if (toConvert is Visibility)
return (Visibility)toConvert != Visibility.Visible;
else
return false;
}
else
{
if (toConvert is Visibility)
return (Visibility)toConvert == Visibility.Visible;
else
return false;
}
}
}
/// <
summary
>
/// Permet les binding entre visibility et boolean
/// </
summary
>
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return VisibilityHelper.BoolToVisibility(value, parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return VisibilityHelper.VisibilityToBool(value, parameter);
}
}
}
PS : Why i can't add attached zip file ... ?
A+
JC