开发者

where does Dispatcher.BeginInvoke put items to? the new pushed frame by pushframe?

I'm working with Dispatcher in wpf, and I'm looking at the following page: http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.pushframe.aspx

there is an example which achieves similar result as the DoEvent method, it first call begininvoke to put an item on the event queue, then pushframe. I'm wondering which frame was put on? the original one or the newly pushed one?

Could anybody shed some light on this? Thank you.

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public void DoEvents()
{
    DispatcherFrame frame = new DispatcherFrame();
    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
        new Disp开发者_JAVA技巧atcherOperationCallback(ExitFrame), frame);
    Dispatcher.PushFrame(frame);
}

public object ExitFrame(object f)
{
    ((DispatcherFrame)f).Continue = false;

    return null;
}


Have a look at this DispatherFrames

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜