docking pin/unpin issue

8 posts, 0 answers
  1. Robert
    Robert avatar
    56 posts
    Member since:
    Sep 2011

    Posted 02 Jun 2014 Link to this post

    Below are the Details for Docking Pin/Unpin issue.

    Control Name -  DockingDlls
    Version - 2014.1.331.45
    Issue – Unable to minimize all Rad Panes in RadPaneGroup (Move all related panes in to vertical bar), when Unpin any one RadPane in RadPaneGroup.

    Implementation -  RadpaneGroup placed inside RadSplitContainer then RadSplitContainer placed inside RadDocking control.

    Added following Pin and Unpin event handlers.   

    private void RadDocking_OnPin(object sender, StateChangeEventArgs e)
            {
                foreach (var moduleItem in e.Panes)
                {
                    var radPaneItem = moduleItem;                if (radPaneItem != null)
                    {
                        if (radPaneItem.PaneGroup.Name == "NavigationPanesGroup")
                        {
                            NavigationPanesGroup.PinAllPanes();
                        }                    if (radPaneItem.PaneGroup.Name == "QuickAccessPanesGroup")
                        {
                            QuickAccessPanesGroup.PinAllPanes();
                        }
                    }
                }
            }        private void RadDocking_OnUnpin(object sender, StateChangeEventArgs e)
            {
                foreach (var moduleItem in e.Panes)
                {
                    var radPaneItem = moduleItem;                if (radPaneItem != null)
                    {
                        if (radPaneItem.PaneGroup.Name == "NavigationPanesGroup")
                        {
                            NavigationPanesGroup.UnpinAllPanes();
                        }                    if (radPaneItem.PaneGroup.Name == "QuickAccessPanesGroup")
                        {
                            QuickAccessPanesGroup.UnpinAllPanes();
                        }
                    }
                }
            }
    Above code works good for Pin/Unpin functionality, But all panes in RadPanesGrup not moving to VerticalBar. Only Unpinned RadPane item is moving to verticalBar.

    Please give pointers/suggestions to unpin and minimize all Radpanes, when we Unpin any RadPane.

    I have attached sample project in this post.
  2. Robert
    Robert avatar
    56 posts
    Member since:
    Sep 2011

    Posted 02 Jun 2014 Link to this post

    I cannot attach my sample project (zip) because I can only add image files.  any workarounds?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Robert
    Robert avatar
    56 posts
    Member since:
    Sep 2011

    Posted 02 Jun 2014 Link to this post

    see http://rwallaceconsulting.com/dockingSample.zip
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 03 Jun 2014 Link to this post

    Hi Robert,

    In the current version of RadDocking when a RadPane instance is being pined or unpinned there is an animation that is triggered. When the OnPin/OnUnpin events of the control are called that animation is still not finished animating. In the case where the PinAllPanes/UnpinAllPanes methods are called there is a timing issue because those method are also triggering those events.

    In order to resolve this timing issue when using the PinAllPanes/UnpinAllPanes methods inside the corresponding events you should wrap the call of the methods with an Dispatcher. The next code snippet shows the described approach:
    Dispatcher.BeginInvoke(new Action(() =>
    {
        NavigationPanesGroup.PinAllPanes();
    }));
     
    Dispatcher.BeginInvoke(new Action(() =>
    {
        NavigationPanesGroup.UnpinAllPanes();
    }));

    Hope this is helpful.

    Regards,
    Vladi
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. Richard
    Richard avatar
    10 posts
    Member since:
    Dec 2014

    Posted 02 Jan 2015 in reply to Vladi Link to this post

    Hello Vlad,
    I implemented your suggestion to get all panes to pin, but now they pin repeatedly and forever, locking up the application. also, panes that are marked CanUserPin="False" collapse. Some panes should never collapse but that line of xaml doesn't work. Is there another property I am unaware of? 

                     <telerik:RadPane Name="PropertiesPane" Header="Properties" CanUserClose="False" CanFloat="False" CanUserPin="False" CanDockInDocumentHost="False">


    thank you.
  7. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 05 Jan 2015 Link to this post

    Hi Richard,

    By design all RadDocking's properties which contain the keyword "User" in them usually remove a visual part (button) in order to hide a functionality from the user. Those properties are not used by other code behind specific methods (which are not user accessible) like the mentioned PinAllPanes/UnpinAllPanes methods. In order to achieve the desired behavior of pinning/unpinning only those RadPanes which do not have their CanUserPin property set to False a custom implementation should be added. What you need to do is rather that calling the UnpinAllPanes() method, go through all of the Panes of a PaneGroup and set each pane's IsPinned to False depending on the value of its CanUserPin property.

    I created and attached a sample project of the described approach for you, hope this is helpful. I also recorded and attached a short video showing how the scenario run on our side. The video can also be found attached to my response.

    Regards,
    Vladi
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Richard
    Richard avatar
    10 posts
    Member since:
    Dec 2014

    Posted 05 Jan 2015 in reply to Vladi Link to this post

    Thank you. This works. I was not familiar with originalsource. I don;t understand how PinAllPanes library method can work fine where UnPinAllPanes has to be customized as "UnPinnPanes" to check the CanUserPin attribute. I would think that would be internalized to the library method or perhaps have two sets of methods by adding something like Force(Un)PinAllPanes()...  One set which checks CanUserPin and one that doesn't.

    Anyway, that's an idea for a future release but you've solved my problem! Thank you most kindly!

    Richard
  9. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 07 Jan 2015 Link to this post

    Hello Richard,

    We are glad that you were able to achieve the desired behavior.

    The reason why the described approach as not used when calling the PinAllPanes is because since the RadPane with CanUserPin set to False is already pinned it will not make a difference if it is pinned again. As described the CanUserPin property or any other property containing the keyword "User" disables a functionality by removing a visual elements but is not taken into account when calling built-in methods from the code behind. This behavior is implemented by design. In the discussed scenario filtering which panes should be unpinned is required in order to not unpin panes with disabled user pin functionality since they will not longer be pinnable by the user.

    Hope this explanation is helpful in understanding how the CanUserPin property functions.

    Regards,
    Vladi
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready