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

(2013.1.220.40) DraggedSokutContainer is obsolete Warning

2 Answers 43 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 01 May 2013, 12:05 AM
**** SORRY - the title should have read 'DraggedSplitContainer is obsolete' - TYPO ****

Hi,

I'm getting the following warning in VS2010 when using wpf libraries 2013.1.220.40.

'Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs.DraggedSplitContainer' is obsolete: 'This should not be used anymore. Use the DraggedElement property instead.

It's relating to the following code I have for conditional pane docking:

private void RadDocking_PreviewShowCompass(object sender, Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs e)
{
    if (e.TargetGroup != null)
    {
        e.Compass.IsCenterIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Center);
        e.Compass.IsLeftIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Left);
        e.Compass.IsTopIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Top);
        e.Compass.IsRightIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Right);
        e.Compass.IsBottomIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Bottom);
    }
    else
    {
        e.Compass.IsLeftIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Left);
        e.Compass.IsTopIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Top);
        e.Compass.IsRightIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Right);
        e.Compass.IsBottomIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Bottom);
    }
    e.Canceled = !(CompassNeedsToShow(e.Compass));
}

CanDockIn Method:
private bool CanDockIn(ISplitItem dragged, ISplitItem target, DockPosition position)
{
    // If there is a pane that cannot be dropped in any of the targeted panes.
    return !dragged.EnumeratePanes().Any((RadPane p) => target.EnumeratePanes().Any((RadPane p1) => !CanDockIn(p, p1, position)));
}


Can you offer any suggestions about how I can fix this?

Thank you for your time,

Rob







 

2 Answers, 1 is accepted

Sort by
0
Lowie
Top achievements
Rank 1
answered on 02 May 2013, 09:56 AM
I fixed it this way:

e.Compass.IsTopIndicatorVisible = CanDockIn(e.DraggedElement, e.TargetGroup, DockPosition.Top);           }

private bool CanDockIn(object dragged, ISplitItem target, DockPosition position)
{
// If there is a pane that cannot be dropped in any of the targeted panes.
if (dragged is ISplitItem)
{
return !((ISplitItem)dragged).EnumeratePanes().Any((RadPane p) => target.EnumeratePanes().Any((RadPane p1) => !CanDockIn(p, p1, position)));
}
 
return false;
}


This worked for me.

Lowie
0
George
Telerik team
answered on 03 May 2013, 08:37 AM
Hello,

We would suggest using e.DraggedElement property instead of e.DraggedSplitContainer. Hope this helps.

Kind regards,
George
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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