我正在将 Windows Phone 7 应用程序转换为 Windows 应用商店,因此我将转向 Xaml。我有一种方法可以在某个时间点运行以更新屏幕上的数据。它为 CompositionTarget.Rendering 事件分配或删除事件处理程序委托。我得到的消息是“OnCompositionTargetRendering”没有重载匹配委托“System.EventHandler”
这是我所拥有的:
private void CheckCompleted()
{
Color completeColor;
if (this.DecryptedText.ToString().ToUpper() == this.ThisPuzzle.QuoteText.ToUpper())
{
// We're done!!! ...
CompositionTarget.Rendering -= this.OnCompositionTargetRendering;// new EventHandler(this.OnCompositionTargetRendering);
...
}
else
{
...
CompositionTarget.Rendering += this.OnCompositionTargetRendering;// new EventHandler(this.OnCompositionTargetRendering);
...
}
}
protected void OnCompositionTargetRendering(object sender, EventArgs args)
{
this.DisplayTime();
if (ThisPuzzle != null)
{
foreach (UIElement thisElement in Letters.Children)
{
...
}
}
}