DispatcherFrame.Continue 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得或設定一個值,指示是否應該繼續此狀態 DispatcherFrame 。
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
屬性值
true如果框架繼續;否則,。 false 預設值為 true。
- 屬性
範例
以下範例展示了如何使用 來 DispatcherFrame 達成與 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
備註
Continue 在每個調度迴圈的頂端查詢。
應用程式關閉時,所有幀皆為請求退出。
XAML 文字使用
此類別的成員通常不在 XAML 中使用,或無法在 XAML 中使用。