[英]dotNet MAUI Shell - Add Flyout Item in C#
好的,所以我自己想通了。 我發現這個頁面讓我走上了正確的道路: https://gist.github.com/TheBaileyBrew/f8a9d2e4668da3ec9bff9bf86d32d951
無論如何,所以基本上我能夠創建一個 XAMLess AppShell.cs 基本上只有這個並且它創建了 Shell 實例,沒問題。
public partial class AppShell : Shell
{
public AppShell()
{
Routing.RegisterRoute(nameof(MainPage), typeof(MainPage));
Items.Add(new FlyoutItem
{
Title = "Home",
Route = x.Route,
Icon = new FontImageSource
{
FontFamily = "fasolid900",
Glyph = FontAwesome.FontAwesomeIcons.Home,
},
Items =
{
new Tab{
Title = "Home",
Items = {
new ShellContent
{
Title = "Home",
Route = nameof(MainPage),
ContentTemplate = new DataTemplate(typeof(MainPage))
}
}
}
}
});
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.