close and show RadDocking programmatically

2 posts, 0 answers
  1. Allel
    Allel avatar
    1 posts
    Member since:
    Sep 2012

    Posted 28 Jan 2014 Link to this post

    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"
                                                  CanUserClose="False" CanUserPin="False" >

    My ViewModel

    public class MyViewModel: ViewModelBase
    public MyViewModel
        Hidden = true ;
    public bool Hidden
                    return hidden;
                        hidden = value;
            private ICommand showCommand;
            private ICommand closeCommand;
            public ICommand CloseCommand
                    if (closeCommand == null)
                        closeCommand = new RelayCommand(param => this.CloseCommandEvent());
                    return closeCommand;
            private void CloseCommandEvent()
                Hidden = true;
            public ICommand showCommand
                    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 :) 
  2. Kalin
    Kalin avatar
    1189 posts

    Posted 31 Jan 2014 Link to this post

    Hi Allel,

    I was not able to reproduce the described issue on our side. I recreated the scenario in a sample project and the Docking was behaving as expected. I am attaching the project here so you can check it, however please note that the Floating Pane is not supposed to hide with Docking as it is located in another visual tree.

    Hope the attached project will help you to achieve the required.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft R3 2016 release webinar banner
Back to Top