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

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

    As far as my observation is concerned, in Visual Studio 2015, XAML properties are already set as suggested by highly-voted answers here by default, specifically :

    • Custom Tool = MSBuild:UpdateDesignTimeXaml
    • Build Action = Embedded Resource

    but the error still appears sometimes... (like in this other question).

    Editing the corresponding XAML file and then hit CTRL+S should work fine, but you don't have to. A cleaner way to force Custom Tools to be run is by right-clicking on the XAML file and then click on "Run Custom Tool" context menu.

提交回复
热议问题