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

前端 未结 30 2361
不知归路
不知归路 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 12:47

    This is probably not your case but I had similar problem and mine was xaml and code behind name missmatching. for example according to your sample, if code behind namespace is XamaTest(name of your app in most cases) and class is called MyXamlPage, your xaml class name must be XamaTest.MyXamlPage ([namespace].[classname])

    I was silly after creating an empty xaml with code behind, I changed name of the class in xaml and i was getting this error.

    
        
    

    Code-behind:

    public partial class MyXamlPage : ContentPage
    

提交回复
热议问题