Application.Idle event not firing in WPF application

前端 未结 2 1228
我在风中等你
我在风中等你 2020-12-11 07:19

I am using a third-party Windows Forms control that performs some actions \"delayed\" using the Application.Idle event.

Now that we\'re moving our application to WPF

2条回答
  •  没有蜡笔的小新
    2020-12-11 07:53

    You should read this page on MSDN which describes the message loop behavior in a WPF application. In particular it looks like the ComponentDispatcher class can be used to catch a ThreadIdle event which would roughly correspond to the Windows Forms Application.Idle event.

    You could then presumably use the System.Windows.Forms.Application.RaiseIdle method to raise the Idle event as the component expects.

提交回复
热议问题