Ejemplo n.º 1
0
        public override void OnEntering(IScreen last)
        {
            applyArrivingDefaults(false);

            backgroundStack?.Push(ownedBackground = CreateBackground());

            background = backgroundStack?.CurrentScreen as BackgroundScreen;

            if (background != ownedBackground)
            {
                // background may have not been replaced, at which point we don't want to track the background lifetime.
                ownedBackground?.Dispose();
                ownedBackground = null;
            }

            base.OnEntering(last);
        }
Ejemplo n.º 2
0
        public override void OnEntering(IScreen last)
        {
            applyArrivingDefaults(false);

            if (AllowTrackAdjustments != null)
            {
                musicController.AllowTrackAdjustments = AllowTrackAdjustments.Value;
            }

            if (backgroundStack?.Push(ownedBackground = CreateBackground()) != true)
            {
                // If the constructed instance was not actually pushed to the background stack, we don't want to track it unnecessarily.
                ownedBackground?.Dispose();
                ownedBackground = null;
            }

            background = backgroundStack?.CurrentScreen as BackgroundScreen;
            base.OnEntering(last);
        }