0
我正在研究一個Xamarin.Forms項目,並且我有這個錯誤,現在我無法解決幾個小時。我希望以前有人遇到類似的問題,並可以分享他們的經驗。按鈕沒有正確的簽名xamarin
我得到A Xamarin.Forms.Xaml.XamlParseException was thrown
這個消息Position 23:5. Method EditInfoClicked does not have the correct signature
我的代碼看起來是這樣的。
XAML語法:
<StackLayout x:Name="_MapStack">
<Button BackgroundColor="#40A6FF"
WidthRequest="100"
BorderRadius="3"
Text="Edit"
FontSize="16"
TextColor="White"
Clicked="EditInfoClicked" />
和C#語法
async Task EditInfoClicked(object sender, EventArgs e)
{
ProfileDetailViewModel viewModel = new
ProfileDetailViewModel (Navigation, user);
var profileDetailPage = new shared.MyProfilePage()
{
BindingContext = viewModel
};
await Navigation.PushAsync(profileDetailPage);
}
返回類型任務需要無效。檢查這個http://stackoverflow.com/questions/12144077/async-await-when-to-return-a-task-vs-void –