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

前端 未结 30 2638
不知归路
不知归路 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:13

    Very simple solution that worked for me:

    • Copy contents of the xaml/cs file
    • Delete the xaml/cs file
    • Create a new class and paste the contents

    Now the InitializeComponent() function appears without red underline.

    Hope this helps someone.

提交回复
热议问题