if (LayoutWithTransition)
{
+ var win = Window.Get(Owner);
+
if (!childLayout.IsReplaceFlag())
{
- NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
+ if (win == null)
+ {
+ NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
+ }
+ else
+ {
+ win.LayoutController.AddToRemovalStack(childLayout);
+ }
}
childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
// Add LayoutItem to the transition stack so can animate it out.
- NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+ if (win == null)
+ {
+ NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+ }
+ else
+ {
+ win.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+ }
}
// Reset condition for animation ready for next transition when required.
if (ownerView?.Layout?.LayoutWithTransition ?? false)
{
- NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(layoutPositionData);
+ var win = Window.Get(Owner);
+ if (win == null)
+ {
+ NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(layoutPositionData);
+ }
+ else
+ {
+ win.LayoutController.AddTransitionDataEntry(layoutPositionData);
+ }
}
else
{