Sdílet prostřednictvím


BindingGroup.BeginEdit Metoda

Definice

Zahájí transakci úprav na zdrojích v sadě BindingGroup.

public:
 void BeginEdit();
public void BeginEdit ();
member this.BeginEdit : unit -> unit
Public Sub BeginEdit ()

Příklady

Následující příklad volá BeginEdit , když se okno načte, aby se zahájila transakce úprav.

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

Poznámky

Pokud zdroje v BindingGroup podpoře zahodí čekající změny, můžete zavolat BeginEdit zahájení transakce úprav, volání pro uložení čekajících změn, volání CommitEdit CancelEdit zahodit čekající změny.

Pro každý objekt, Items který implementuje IEditableObject, BeginEdit volání IEditableObject.BeginEdit

Platí pro