我開發在Windows 8的Visual Studio 11的應用程序,我想定義的事件處理程序,如下一DispatcherTimer實例:定義事件處理程序,在Windows DispatcherTimer的Tick事件8應用
public sealed partial class BlankPage : Page
{
int timecounter = 10;
DispatcherTimer timer = new DispatcherTimer();
public BlankPage()
{
this.InitializeComponent();
timer.Tick += new EventHandler(HandleTick);
}
private void HandleTick(object s,EventArgs e)
{
timecounter--;
if (timecounter ==0)
{
//disable all buttons here
}
}
.....
}
但我得到以下錯誤:
Cannot implicitly convert type 'System.EventHandler' to 'System.EventHandler<object>'
我是一個新手開發寡婦8應用程序。
你能幫我嗎?
的變化,但我們不Windows應用程序有這個問題?我們要不要 ? –
代理和事件處理程序在整個平臺上都是相同的。這不是一個「問題」,它是如何工作:) – danielovich
問題我的意思是'System.EventHandler