사용하는 UI를 업데이트 할 수있는 방법이 내가 사용하는 기능입니다 :내가 Thread.sleep를
private void Convert2Morse(object obj)
{
TextConverted = am.Convert(NormalText);
foreach (char symbol in TextConverted)
{
int milliseconds = 0;
switch (symbol)
{
case '·': milliseconds = 500; break;
case '—': milliseconds = 1000; break;
case ' ': continue;
default: throw new Exception("Something is wrong");
}
System.Media.SystemSounds.Beep.Play();
System.Threading.Thread.Sleep(milliseconds);
}
}
TextConverted 속성은 텍스트 상자에 보여되지만 서브 루틴을 완료 할 때까지 새로 고쳐집니다.
새로 고침 UI를 표시 할 수있는 방법이 있습니까?
[이 질문에] (http://stackoverflow.com/questions/6117293/synchronous-wait-without-blocking-the-ui-thread/6117313) 유사/관련성이있는 것 같습니다. –