0

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 DispatcherOperationCallback(ExitFrame), frame);
    Dispatcher.PushFrame(frame);
}

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

    return null;
}
4

1 回答 1

-1

看看这个DispatherFrames

于 2011-10-05T09:47:21.687 回答