This is the same question and answer here:
The name 'InitializeComponent' does not exist in the current context
You might get this error when you import a class from another project, or change the path of the xaml file, or the namespace of either the xaml or behind .cs file.
One: It might have a namespace that is not the same as what you have in you new project
namespace TrainerB.MVC.Forms
{
public partial class AboutDeveloper : ContentPage
{
public AboutDeveloper()
{
InitializeComponent();
}
}
}
As you can see the name space in the imported file begins with the old project name: "TrainerB", but your new project might have a different name, so just change it to the correct new project name, in both the .xaml file and the behind .cs file.
Two:
change the properties of the .xaml file to:
Build Action: Embedded Resource
Custom Tool: MSBuild:UpdateDesignTimeXaml