Bug on docking binding with MVVM and MEF

2 posts, 0 answers
  1. ricky wu
    ricky wu avatar
    9 posts
    Member since:
    Feb 2010

    Posted 16 Mar 2010 Link to this post

    Core code:
    C# code behind:
        public Mainpage(){
            this.datacontext = viewModel;
        }
        [Import]
        public MainPageViewModel ViewModel{get;set;}
    C# ViewModel :
       public MainPageViewModel(){
        TopWidgets = new Obserablecollection<RadPane>();
        public Obserablecollection<RadPane> TopWidgets{get;set;}
       void TriggerRadPaneLoaded(){
            TopWidgets.Add(new RadPane(){ header=" topPane"}
        }
    Xaml:
    <telerikcontrol:Raddocking>
        <telerikcontrol:radsplitContainer>
            <telerikcontrol:RadPaneGroup itemsSource = "{Binding TopWidgets}"/>
        </telerikcontro:radsplitcontainer>
    </telerikcontrol:raddockking>
    After I loaded the RadPane through viewmodel, Every thing is find because i manipulate the collection in the view model. However, there is a exception when I try to drag the pane to re locate it. I assumed the relocate the radpane also manipulate the binding property which is TopWidgets. But it is not.
    Exception:
     at System.Windows.Controls.ItemCollection.RemoveImpl(Object value)
       at System.Windows.Controls.ItemCollection.RemoveInternal(Object value)
       at System.Windows.PresentationFrameworkCollection`1.Remove(T value)
       at Telerik.Windows.Controls.RadPaneGroup.RemovePane(RadPane pane)
       at Telerik.Windows.Controls.RadPane.RemoveFromParent()
       at Telerik.Windows.Controls.RadDocking.MoveItems(RadTabControl source, RadTabControl destination)
       at Telerik.Windows.Controls.RadDocking.OpenInToolWindow(RadPaneGroup radPaneGroup)
       at Telerik.Windows.Controls.RadDocking.ShowElement(DragInfoEventArgs e)
       at Telerik.Windows.Controls.RadDocking.OnDragDelta(Object sender, DragInfoEventArgs e)
       at Telerik.Windows.Controls.Docking.DragInfoEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
       at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
       at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
       at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
       at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
       at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
       at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, UIElement dragRoot, MouseEventArgs e)
       at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, MouseEventArgs e)
       at Telerik.Windows.Controls.Docking.PaneHeader.OnMouseMove(MouseEventArgs e)
       at System.Windows.Controls.Control.OnMouseMove(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)    

         
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 18 Mar 2010 Link to this post

    Hello ricky wu,

    Using ItemsSource with RadDocking is not supported. You should manually create RadPanes and add them to the RadPaneGroup.Items collection.

    All the best,
    Hristo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top