Пример #1
0
        public void NavigateTo(Type screen)
        {
            IScreen newScreen = CreateInstance(screen);

            ActivateScreen?.Invoke(this, new ManageScreenRequest
            {
                Screen = newScreen
            });
            if (activeItem != null)
            {
                History.Enqueue(activeItem);
            }
            activeItem = newScreen;
        }
Пример #2
0
        public void GoBack()
        {
            DeactivateScreen?.Invoke(this, new ManageScreenRequest
            {
                Close  = true,
                Screen = activeItem
            });
            IScreen newScreen = History.Dequeue();

            ActivateScreen?.Invoke(this, new ManageScreenRequest
            {
                Screen = newScreen
            });
            activeItem = newScreen;
        }
Пример #3
0
        public void Load(Type screen)
        {
            DeactivateScreen?.Invoke(this, new ManageScreenRequest
            {
                Close  = true,
                Screen = activeItem
            });
            IScreen newScreen = CreateInstance(screen);

            ActivateScreen?.Invoke(this, new ManageScreenRequest
            {
                Screen = newScreen
            });
            activeItem = newScreen;
            History.Clear();
        }