在下面的 F# WPF 代码中,当我从 F# FSI 中“显示”WPF 窗口时,无法在文本框中输入任何文本。这是否与使用 Windows Forms 事件循环有关?
根据下面John Palmer的回答,我已经更新了上面的代码到正确版本。下面的代码现在可以在F# FSI中正常工作。
let txtBox = new TextBox()
txtBox.BorderThickness <- Thickness(2.)
txtBox.Margin <- Thickness(7.)
txtBox.IsReadOnly <- false
let wnd = new Window(Title = "Test", Height = 500., Width = 500.)
wnd.Content <- txtBox
wnd.Show()
根据下面John Palmer的回答,我已经更新了上面的代码到正确版本。下面的代码现在可以在F# FSI中正常工作。
let txtBox = new TextBox()
txtBox.BorderThickness <- Thickness(2.)
txtBox.Margin <- Thickness(7.)
txtBox.IsReadOnly <- false
let wnd = new Window(Title = "Test", Height = 500., Width = 500.)
wnd.Content <- txtBox
(new Application()).Run(wnd) |> ignore