두 번 호출 한 다음 다른 개체에서 한 번 더 호출하려고합니다.두 스레드에서 WPF가 호출됩니다.
public void Show()
{
if (mainGrid == null)
return;
if (!Dispatcher.CheckAccess())
{
Dispatcher.BeginInvoke(new ThreadStart(delegate() { Show(); }), DispatcherPriority.Background);
return;
}
mainGrid.Children.Add(rec);
rec.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
rec.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
mainGrid.Children.Add(this);
this.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
this.VerticalAlignment = System.Windows.VerticalAlignment.Center;
}
두 물체 B, C가 A로부터이 기능을 상속 : I이 프로세스에서 호출 될 때 B.show()을 주제와 C.show()에서 B.showStop()는 I 메인 권한 사용에 대한 예외를 얻을 .children.Add (..) C.show() 이 문제를 해결할 수 있도록 도와주세요.
두 번째 메소드 선언을 제거한 것은 똑같은 것으로 보입니다. (실수로 두 번 붙여 넣었습니까?) –
실제 예외는 무엇입니까? 그리고'showStop()'의 코드는 무엇입니까? – svick