DispatcherFrame.Continue Propriedade

Definição

Recebe ou define um valor que indica se isto DispatcherFrame deve continuar.

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

Valor de Propriedade

true se a estrutura continuar; caso contrário, false. O valor predefinido é true.

Atributos

Exemplos

O exemplo seguinte mostra como usar um DispatcherFrame para obter resultados semelhantes ao método 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

Observações

Continue é consultado no topo de cada loop de despachante.

No encerramento da aplicação, todos os frames são solicitados a sair.

Utilização de Texto XAML

Os membros desta classe ou não são normalmente usados em XAML, ou não podem ser usados em XAML.

Aplica-se a

Ver também