示例#1
0
        public void Apply(Navigator navigator, ScreenStack screens)
        {
            if (screens.IsRoot)
            {
                return;
            }

            screens.Clear();
            navigator.BackToRoot();
        }
示例#2
0
        public void ClearEmptyStackScreen()
        {
            // - Arrange
            var rootScreen  = new Mock <Screen>().Object;
            var screenStack = new ScreenStack();

            // - Act
            screenStack.Clear();

            // - Assert
            Assert.IsTrue(screenStack.IsRoot);
            Assert.IsNull(screenStack.CurrentScreen);
            Assert.AreEqual(0, screenStack.Count);
        }
示例#3
0
        public void ClearStackWithOnlyRootScreen()
        {
            // - Arrange
            var rootScreen  = new Mock <Screen>().Object;
            var screenStack = new ScreenStack();

            screenStack.Push(rootScreen);

            // - Act
            screenStack.Clear();

            // - Assert
            Assert.IsTrue(screenStack.IsRoot);
            Assert.AreEqual(rootScreen, screenStack.CurrentScreen);
            Assert.AreEqual(1, screenStack.Count);
        }
示例#4
0
 public void Reset()
 {
     ScreenStack.Clear();
     ScreenStack.Push(new MainMenu(Context, this));
 }