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
265
NullReferenceException when programmatically change a pane to floating
posted

Hi,

I have a DocumentContentHost containing a few tab group panes, and I've implemented an attached property (as presented in this forum) to raise a routed event when the pane location property is changed. In my routed event handler, there is a check that if the pane doesn't satisfy a certain condition then it will programmatically move the pane to floating, when this line is executed it's throwing a null reference exception. Can you please shed some light on this? Please see code below:

 

private 

 

void contentpane_PaneLocationChanged(object sender, GenericRoutedEventArgs<PaneLocation> e)

{

 

 

        if (!conditionSatisfied)

        {

              ContentPaneCommands.ChangeToFloatingOnly.Execute("", pane);   //throws below exception ....

        }

 }

Exception:

 

System.NullReferenceException occurred

Message="Object reference not set to an instance of an object."

Source="Infragistics3.Wpf.DockManager.v9.2"

StackTrace:

at Infragistics.Windows.DockManager.DockManagerUtilities.MovePane(ContentPane pane, IContentPaneContainer newContainer, Nullable`1 newIndex, PaneLocation newLocation)

InnerException:

Thanks,

Tess