(2013.1.220.40) DraggedSokutContainer is obsolete Warning

3 posts, 0 answers
  1. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 30 Apr 2013 Link to this post

    **** 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. Lowie
    Lowie avatar
    21 posts
    Member since:
    Apr 2013

    Posted 02 May 2013 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. George
    Admin
    George avatar
    1332 posts

    Posted 03 May 2013 Link to this post

    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.

Back to Top