I have two buttons one to show and other to close my RadDoking. By default, the RadDoking is deactivated(not show), when I press the show button, the RadDoking opens but on I prese my close button it does not work
My Xaml :
<
telerik:RadDocking
Grid.Column
=
"1"
x:Name
=
"radDocking1"
Grid.Row
=
"1"
Margin
=
"0 0 0 10"
BorderThickness
=
"0"
Visibility
=
"{Binding Hidden,ConverterParameter=True, Mode=TwoWay, Converter={StaticResouce CvtVisibilityConverter}}"
Padding
=
"0"
>
<
telerik:RadSplitContainer
InitialPosition
=
"FloatingOnly"
telerik:RadDocking.FloatingLocation
=
"450, 250"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Title
=
"My Pane"
CanDockInDocumentHost
=
"False"
CanUserClose
=
"False"
CanUserPin
=
"False"
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
My ViewModel
public
class
MyViewModel: ViewModelBase
{
public
MyViewModel
{
Hidden =
true
;
}
public
bool
Hidden
{
get
{
return
hidden;
}
set
{
hidden = value;
OnPropertyChanged(
"Hidden"
);
}
}
private
ICommand showCommand;
private
ICommand closeCommand;
public
ICommand CloseCommand
{
get
{
if
(closeCommand ==
null
)
closeCommand =
new
RelayCommand(param =>
this
.CloseCommandEvent());
return
closeCommand;
}
}
private
void
CloseCommandEvent()
{
Hidden =
true
;
}
public
ICommand showCommand
{
get
{
if
(showCommand ==
null
)
showCommand =
new
RelayCommand(param =>
this
.ShowCommandEvent());
return
showCommand;
}
}
private
void
ShowCommandEvent()
{
Hidden =
false
;
}
}
My Converter
public
class
VisibilityConverter : IValueConverter
{
public
object
Convert(
object
value, Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
if
(value ==
null
|| !(value
is
Boolean))
return
Visibility.Collapsed;
var parm = parameter ??
false
;
bool
flip;
Boolean.TryParse(parm.ToString(),
out
flip);
var visible = flip ? !((
bool
)value) : (
bool
)value;
return
visible ? Visibility.Visible : Visibility.Collapsed;
}
public
object
ConvertBack(
object
value, Type targetType,
object
parameter, System.Globalization.CultureInfo culture)
{
throw
new
NotImplementedException();
}
}
I do not understand why it does not work, Thank you for your help :)