简体   繁体   English

<NewEventHandler>在Visual Studio中不显示

[英]<NewEventHandler> in Visual Studio Not Showing Up

I was just doing a bit of Visual Studio 2012 for Windows Phone 8, but when I started typing Click="" in the .xaml file, no thing showed up in a dropdown list. 我只是为Windows Phone 8做一点Visual Studio 2012,但是当我开始在.xaml文件中键入Click =“”时,下拉列表中没有任何显示。 It used to show up but now it isn't! 它曾经出现过,但现在却没有!

Have you tried restarting your computer? 您是否尝试过重新启动计算机? That often fixes these types of issues (sometimes just restart Visual Studio does the trick). 这通常可以解决这些类型的问题(有时只需重新启动Visual Studio即可解决问题)。

That said, you can always generate your own event handlers. 也就是说,您始终可以生成自己的事件处理程序。 Intellisense is great; Intellisense很棒; but not having it should not cripple you. 但没有它不应该使您瘫痪。 The below should work, adjusting for your button name. 以下应该可以工作,并根据您的按钮名称进行调整。

//code-behind
private void btnYourButton_Click(object sender, EventArgs e)
{
    //do stuff
}

<!--xaml-->
<Button x:Name="btnYourButton" Click="btnYourButton_Click"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM