BindingGroup.BeginEdit メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
BindingGroup内のソースに対して編集トランザクションを開始します。
public:
void BeginEdit();
public void BeginEdit();
member this.BeginEdit : unit -> unit
Public Sub BeginEdit ()
例
次の例では、ウィンドウが読み込まれたときに BeginEdit を呼び出して、編集トランザクションを開始します。
void stackPanel1_Loaded(object sender, RoutedEventArgs e)
{
// Set the DataContext to a PurchaseItem object.
// The BindingGroup and Binding objects use this as
// the source.
stackPanel1.DataContext = new PurchaseItem();
// Begin an edit transaction that enables
// the object to accept or roll back changes.
stackPanel1.BindingGroup.BeginEdit();
}
Private Sub stackPanel1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
' Set the DataContext to a PurchaseItem object.
' The BindingGroup and Binding objects use this as
' the source.
stackPanel1.DataContext = New PurchaseItem()
' Begin an edit transaction that enables
' the object to accept or roll back changes.
stackPanel1.BindingGroup.BeginEdit()
End Sub
注釈
BindingGroupのソースが保留中の変更の破棄をサポートしている場合は、BeginEditを呼び出して編集トランザクションを開始し、CommitEdit呼び出して保留中の変更を保存し、CancelEdit呼び出して保留中の変更を破棄できます。
IEditableObject、BeginEdit呼び出しを実装するItems内の各オブジェクトについてIEditableObject.BeginEdit