Xamarin表格InitializeComponent不存在 [英] Xamarin Forms InitializeComponent does not exist

查看:124
本文介绍了Xamarin表格InitializeComponent不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Visual Studio 2015的Xamarin表单,并尝试使用Xaml创建一个简单的共享项目,但是我一直在获取InitializeComponent不存在(以及cs类中对Xaml控件的任何引用).

I am learning Xamarin Forms for Visual Studio 2015 and trying to create a simple Shared project using Xaml but I keep getting InitializeComponent does not exist (as well as any reference to Xaml controls in cs classes).

据我了解,在最新版本的Xamarin中,Xaml可在Shared Xamarin Forms Projects中使用(不仅在PCL项目中).我试过运行不到一个月前发布的最新Beta,但仍然没有运气.

It is my understanding that in the latest versions of Xamarin, Xaml works in Shared Xamarin Forms Projects (and not only in PCL projects). I've tried running the latest betas that got released less than a month ago but still no luck.

任何建议都将不胜感激.

Any advice is greatly appreciated.

推荐答案

原来,我不得不手动更改所有Xaml文件的属性,如下所示:

Turns out I had to manually change the properties for all Xaml files like so:

Build Action: Embedded resource
Custom Tool: MSBuild:UpdateDesignTimeXaml

由于某些原因,在最新的Xamarin的VS2015中,默认情况下,添加新的Xaml表单文件不会设置这些文件.

For some reason adding new Xaml forms files doesn't set these by default in VS2015 with latest Xamarin.

这篇关于Xamarin表格InitializeComponent不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆