private void OnOpenScreenRequest(OpenScreenRequestSignal signal) { // First check if the type of screen is already opened (unless it's forced by setting the 'ForceOpen' property) if (!signal.ForceOpen) { var screenExistsInNavigationStack = _navigationStack.Any(item => item.Type == signal.Type); if (screenExistsInNavigationStack) { return; // If the type of screen does exists in the navigation stack we ignore the request } } var screenController = _screenFactory.Create(signal.Type); // Blur the previous screen (if there is one) if (_navigationStack.Count > 0) { _navigationStack.Last().ScreenController.Blur(); } // Push the new screen to the navigation stack and 'open' it var newScreenStackItem = new ScreenStackItem { Type = signal.Type, ScreenController = screenController }; _navigationStack.Push(newScreenStackItem); // Focus the new screen screenController.Focus(); _currentFocussed = newScreenStackItem; screenController.Open(); }
private void OnOpenScreenRequestSignal(OpenScreenRequestSignal signal) { var openMethod = GetType().GetMethod("OpenScreen").MakeGenericMethod(signal.ScreenType); openMethod.Invoke(this, new object[] { signal.Animation }); }