DispatcherFrame.Continue Egenskap

Definition

Hämtar eller anger ett värde som anger om detta DispatcherFrame ska fortsätta.

public:
 property bool Continue { bool get(); void set(bool value); };
public bool Continue { get; [System.Security.SecurityCritical] set; }
public bool Continue { get; set; }
[<set: System.Security.SecurityCritical>]
member this.Continue : bool with get, set
member this.Continue : bool with get, set
Public Property Continue As Boolean

Egenskapsvärde

trueom ramen ska fortsätta; annars . false Standardvärdet är true.

Attribut

Exempel

I följande exempel visas hur du använder en DispatcherFrame för att uppnå liknande resultat som metoden Windows Forms DoEvents.

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;
}
<SecurityPermissionAttribute(SecurityAction.Demand, Flags := SecurityPermissionFlag.UnmanagedCode)>
Public Sub DoEvents()
    Dim frame As New DispatcherFrame()
    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, New DispatcherOperationCallback(AddressOf ExitFrame), frame)
    Dispatcher.PushFrame(frame)
End Sub

Public Function ExitFrame(ByVal f As Object) As Object
    CType(f, DispatcherFrame).Continue = False

    Return Nothing
End Function

Kommentarer

Continue efterfrågas överst i varje dispatcher-loop.

Vid programavstängning begärs alla ramar att avslutas.

XAML-textanvändning

Medlemmar i den här klassen används vanligtvis inte i XAML eller kan inte användas i XAML.

Gäller för

Se även