我正在创建一个应用程序,其中我想要所有 xaml 页面通用的页脚。我尝试了此链接xamarin 论坛上给出的解决方案
但它显示部分类 bcoz 的错误我在继承类PageToInherit时使用xamarin xaml 表单页面。如果我只使用页面(仅 .cs 文件),则没有错误。
public partial class TodoList : PageToInherit
{
public TodoList()
{
InitializeComponent();
this.Title = "TodoList page";
Button button = new Button();
button.Text = "BUTTON 1";
MainStackLayout.Children.Add(button);
Content = MainStackLayout;
}
}
Run Code Online (Sandbox Code Playgroud)