0
我正在将Windows Phone 7应用程序转换为Windows应用商店,因此我将转移到Xaml。我有一个运行在某个点上的方法来更新屏幕上的数据。它会将事件处理程序委托分配或移除到CompositionTarget.Rendering事件。我得到的消息是“OnCompositionTargetRendering”匹配委托“System.EventHandler”“不超载CompositionTarget.Rendering不喜欢我在XAML中的事件处理程序
这是我有:
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)
{
...
}
}
}
哦..对象ARGS ...我看到的文档中,从私人到保护的变化...我会试试,谢谢。 – 2013-04-04 16:00:54