Xamarin.Forms - InitializeComponent doesn't exist when creating a new page

前端 未结 30 2295
不知归路
不知归路 2021-01-30 12:36

I\'m using Visual Studio to try out Xamarin.Forms. I\'m trying to follow the guide: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/xaml-for-xamarin-forms/getti

30条回答
  •  走了就别回头了
    2021-01-30 13:06

    I get this sometimes and here's the checklist that solved them so far:

    1. Make sure the namespace in .xaml and .xaml.cs match

    2. Inherit from the correct parent - ContentPage for a page and ContentView for a control

    3. Set build action of the .xaml file to Embedded Resource if in the shared project.

提交回复
热议问题