В частности, следующий код не работает должным образом:
Код: Выделить всё
private readonly INavigationService _navigationService;
private UIElement? _shell;
public LoginViewModel(IAuthService authService, INavigationService navigationService)
{
_authService = authService;
_navigationService = navigationService;
}
if (loginSuccessful)
{
// Not working in this context
_navigationService.NavigateTo(typeof(ShellViewModel).FullName!);
// Works but doesn't show full content of ShellPage (doesn't automatically activate BlankPage)
var shell = App.GetService();
App.MainWindow.Content = shell ?? (UIElement)new Frame();
}
Код: Выделить всё
public void NavigateToSignUp()
{
_navigationService.NavigateTo(typeof(SignUpViewModel).FullName!);
}
Код: Выделить всё
// Works but doesn't show full content of ShellPage (doesn't automatically activate BlankPage)
var shell = App.GetService();
App.MainWindow.Content = shell ?? (UIElement)new Frame();
введите здесь описание изображения
Но от меня ожидают:
введите здесь описание изображения
(ShellPage включен AccountPage)
Как я могу успешно перейти к ShellPage после входа в систему и убедиться, что ShellPage отображает полное содержимое (включая автоматическую активацию учетной записи по умолчанию)?
Подробнее здесь: https://stackoverflow.com/questions/791 ... sful-login