详细了解 Microsoft.Maui.Controls 命名空间中的 Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters。
CurrentItem属于ShellItem类型,是当前选定的项。 CurrentPage属于Page类型,是当前显示的页面。 CurrentState属于ShellNavigationState类型,是当前Shell的导航状态。 Current,类型Shell,提供对当前 Shell 的访问权限。 BackButtonBehavior、CurrentItem和CurrentState属性由BindableProperty对象提供支持,这意味着这些属性可以作为数据绑...
Shell 导航获得GoToAsync重载,支持将导航发生后被清除的一次性导航数据作为ShellNavigationQueryParameters对象传递。 有关详细信息,请参阅传递一次性基于对象的导航数据。 平台集成 当应用位于前台时,Geolocation类可以侦听位置更改。 有关详细信息,请参阅侦听位置更改。
示例: Shell.Current.GoToAsync("..");// 导航到前一页Shell.Current.GoToAsync(nameof(NotePage));// 导航到Note页Shell.Current.GoToAsync($"{nameof(NotePage)}?{nameof(NotePage.ItemId)}={Value}");// 导航到Note页并给Note页的ItemId变量赋值,需要标识NotePage类,如下两行// [QueryProperty(nameof(I...
可使用 TabBar 对象在 .NET MAUI shell 应用中实现选项卡导航。 TabBar 对象显示一组选项卡,可在用户选择选项卡时自动切换显示的内容。下图显示了 UI 区域。若要在 .NET MAUI Shell 应用程序中使用选项卡,请创建 TabBar 类的一个实例作为 Shell 类的子级。 然后将 Tab 对象添加到 TabBar。在 Tab 对象中,...
注:需要在AppShell.cs的public AppShell()方法中注册此页面Routing.RegisterRoute(nameof(NotePage), typeof(NotePage)); // 注册页面 示例: awaitNavigation.PushAsync(newHelloXamlPage()); 其他: Routing.RegisterRoute(nameof(TodoItemPage),typeof(TodoItemPage)); ...
路由方式的导航 - Shell 视觉层次结构中隐式注册的路由。 页面导航 - 模式导航页面可以从应用的任何位置推送到堆叠导航。 PushAsync或PushModalAsync可以按文件名的页面导航 publicasyncTaskPushAsync(stringpageName,object[]args=null){varpage=GetPageInstance(pageName,args);awaitmainPageNavigation.PushAsync(page);}...
使用Shell导航时,有关传递数据的语法,请参阅官方文档。另外,您可以通过官方查看这个QuickStart,它还...
both. To home screen via a login/landing view I navigate Shell.Current.GoToAsync and we have various paths of navigation via the stack Push and Pop, which as the shell navigation replaces the stack it was the cleanest way to clear the stack without getting unknown exceptions, when going ...
This also demonstrates one of the powerful features of navigation in Shell: query parameters for passing simple data. In this case the “Show.Id” is passed with the route and then Shell will apply that value to the binding context ofShowDetailPagemaking it instantly ready for use. The “Qu...