LinqPad에서 WPF 객체를 정상적으로 인스턴스화 할 수있는 방법이 있습니까? 여기 내 예 (등, 올바른 어셈블리가 쿼리에 추가됩니다)입니다 :LinqPad에서 WPF 예제 만들기
var w = new Window();
w.Loaded += (o,e) => {
w.Content = new TextBlock() { Text = "Foo" };
};
w.Show();
을하지만,이 끔찍한 죽음을 죽는다 :
System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.
at System.Windows.Input.TextServicesContext.StopTransitoryExtension()
at System.Windows.Input.TextServicesContext.Uninitialize(Boolean appDomainShutdown)
at System.Windows.Input.TextServicesContext.TextServicesContextShutDownListener.OnShutDown(Object target, Object sender, EventArgs e)
at MS.Internal.ShutDownListener.HandleShutDown(Object sender, EventArgs e)
나는이 작업을 얻을 수있는 방법에 대한 단서를?
업데이트 :이 최근 LINQPad 베타에서 해결 - 당신은 당신이 원하는 방식으로 WPF 창을 표시 할 수 있으며,을 끔찍한 죽음은 없습니다. 또한 다음을 수행하면 출력 패널에 WPF 요소가 표시됩니다. PanelManager.DisplayWpfElement (new TextBlock() {Text = "Foo"}); –