问题描述
好吧,在Windows窗体中可以使用 .REFRESH()
来引起元素的重绘事件。在WPF中类似的解决方案?
Okay, in windows forms you can use .refresh()
to cause a redraw event on an element. Is there a similar solution in WPF?
的我在做什么,我画一个画布对象上的迷宫,想收看的一种解释迷宫绘制(这样我就可以看到你的进步),而不是等待28分钟的突然出现一个解决方案。我在画布上绘制块与一系列长方形
取值。 ?如果刷新是对矩形或画布
An explanation of what I'm doing, I'm drawing a maze on a canvas object, and would like to watch as the maze is drawn (so I can see progress) instead of waiting 28 min for a solution to suddenly appear. I am drawing blocks on the canvas with a series of Rectangle
s. Should the refresh be on the rectangle or the canvas?
下面是最近的输出:
的
我想在C#中的解决方案,如果这是可能的。谢谢你。
I'd like a solution in c# if that is possible. Thanks.
推荐答案
您可能需要使用的对象。我建议你看看这一个肖恩Wildermuth的文章:(MSDN杂志2007年10月)。
You probably want to use the Dispatcher object. I suggest you take a look a this Shawn Wildermuth's article: Build More Responsive Apps With The Dispatcher (MSDN magazine October 2007).
这篇关于WPF迫使重绘帆布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!