StateBag.SetItemDirty(String, Boolean) 方法

定義

設定 Dirty 物件中指定 StateItem 物件的 StateBag 屬性。Sets the Dirty property for the specified StateItem object in the StateBag object.

public:
 void SetItemDirty(System::String ^ key, bool dirty);
public void SetItemDirty (string key, bool dirty);
member this.SetItemDirty : string * bool -> unit
Public Sub SetItemDirty (key As String, dirty As Boolean)

參數

key
String

索引鍵,識別 StateItem 中要設定的 StateBagThe key that identifies which StateItem in the StateBag to set.

dirty
Boolean

true 表示標記項目狀態為已修改,否則為 falsetrue to mark the state of the item as modified; otherwise, false.

備註

SetItemDirty 方法是用來防止或強制特定屬性(以 StateBag 集合中的 StateItem 物件表示)的狀態管理。The SetItemDirty method is used to prevent or force state management of specific properties, represented by StateItem objects in the StateBag collection.

適用於

另請參閱