我正在尝试更改我的 MainPage,根据我的 RadioButton Group 中标记的页面,在我的设置中。因此,如果标记第一个将是“APage”,否则,“BPage”。但是当我尝试更改MainPage = new AppShell();
它时,只需忽略并且不要转到另一页。我的标准 MainPage 注册为:
<ShellContent Title="{x:Static resource:AppResources.home}" Icon="home_icon.png" Route="MainPage" ContentTemplate="{DataTemplate local:MainPage}" />
,但我试图删除它Route
并执行以下操作:
DatabaseAccess DAO = new DatabaseAccess();
if (Convert.ToInt32(DAO.GetRadioValue()[0].RadioButtonValue) == 1)
category.Route = "MainPage";
else
home.Route = "MainPage";
但它仍然不起作用。即使我去我的标准 MainPage 的代码隐藏并且Shell.Current.GoToAsync(nameof(CategoryPage));
什么都不做。
有任何想法吗?