This is a migrated thread and some comments may be shown as answers.

docking pin/unpin issue

7 Answers 321 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 02 Jun 2014, 09:54 PM
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.

7 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 02 Jun 2014, 09:55 PM
I cannot attach my sample project (zip) because I can only add image files.  any workarounds?
0
Robert
Top achievements
Rank 1
answered on 02 Jun 2014, 09:57 PM
see http://rwallaceconsulting.com/dockingSample.zip
0
Vladi
Telerik team
answered on 03 Jun 2014, 02:58 PM
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.
 
0
Richard
Top achievements
Rank 1
answered on 02 Jan 2015, 05:40 PM
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.
0
Vladi
Telerik team
answered on 05 Jan 2015, 11:37 AM
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.

 
0
Richard
Top achievements
Rank 1
answered on 05 Jan 2015, 01:51 PM
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
0
Vladi
Telerik team
answered on 07 Jan 2015, 08:57 AM
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.

 
Tags
Docking
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Vladi
Telerik team
Richard
Top achievements
Rank 1
Share this question
or