Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1158
Resizing a Pane after a code-behind relocation throw an EXCEPTION on Infragistics.Controls.Layouts.PaneBase.ResizableBorder_MouseMove()
posted

Hi to all,

A strange issue... this is the stack of the exception:
Infragistics.Controls.Layouts.PaneBase.ResizableBorder_MouseMove(Object sender, MouseEventArgs e) on
MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)  on
MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

 I designed in XAML this situation: DocumentHost with <ig:TabGroupPane x:Name="xdmTabGrpMain"> without any child and in xdm.Panes: one bottom panel <ig:ContentPane x:Name="cpAlarms" IsPinned="True" Header="ALLARMI" Location="Bottom"> and one left panel <ig:ContentPane x:Name="cpPlants" Location="Left" AllowClose="False">.
The UI logic behind move the cpPlants from Panes to xdmTabGrpMain.Panes when there are not details to show; when there are details it move the cpPlants into  xdm.Panes: (for showing it on the left of DocumentHost now filled with one or more panes of details).

After the code moved  cpPlants into xdm.Panes and you try to resize the left area SL raise this exception and if you try to move or "touch" the Panel the SL applet going into a loop and you need to kill the process of the browser!

MIND: if you re-creat the same situation via XAML the resizing WORKS FINE!!

Any idea about the issue?

The code:
 

void Panes_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (xdmTabGrpMain.Panes.Contains(cpPlants) && xdmTabGrpMain.Panes.Count > 1)
{
this.Dispatcher.BeginInvoke(delegate()
{
xdmTabGrpMain.Panes.CollectionChanged -= Panes_CollectionChanged;

xdmTabGrpMain.Panes.Remove(cpPlants);
cpPlants.Location = XamDockLocation.Left;
xdmMain.ClosedPanes
xdmMain.Panes.Add(cpPlants);
xdmMain.InvalidatePanes();
xdmTabGrpMain.Panes.CollectionChanged += Panes_CollectionChanged;
});
}
else if (xdmTabGrpMain.Panes.Count == 0)
{
this.Dispatcher.BeginInvoke(delegate()
{
xdmTabGrpMain.Panes.CollectionChanged -= Panes_CollectionChanged;
xdmMain.Panes.Remove(cpPlants);
 xdmMain.DocumentContentHost.Panes.Add(xdmTabGrpMain);
xdmTabGrpMain.Panes.Add(cpPlants);
xdmTabGrpMain.Panes.CollectionChanged += Panes_CollectionChanged;
});
}
}

I've also tried to call InvalidatePanes() without success.

Thank you for any help about this issue.

Parents
No Data
Reply
  • 1158
    Verified Answer
    Offline posted

    SOLVED!

    I changed with this code to "separate" the actions that interacts with XamDockManager:

    if (xdmTabGrpMain.Panes.Contains(cpPlants) && xdmTabGrpMain.Panes.Count > 1)
    {
     this.Dispatcher.BeginInvoke(delegate()
      {
        xdmTabGrpMain.Panes.CollectionChanged -= Panes_CollectionChanged;
        xdmTabGrpMain.Panes.Remove(cpPlants);
        cpPlants.Location = XamDockLocation.Left;
        this.Dispatcher.BeginInvoke(delegate()
        {
            xdmMain.Panes.Add(cpPlants);
            xdmTabGrpMain.Panes.CollectionChanged += Panes_CollectionChanged;

        });
      });
    }

    Encapsulating in a Dispatcher call the code that add the pane to .Panes worked!

    In few word... if you call sequentially Remove() and Add() for a Pane in a XamDM you may be in serious trouble ;)
    FOR INFRAGISTICS DEVELOPERS ==> During the debug, i saw that the Owner of Pane was remained "TabGrp", also after Remove and Add actions, and that sound me bad.

     

Children
No Data