BindingGroup.BeginEdit Metodo

Definizione

Avvia una transazione di modifica sugli oggetti origine di associazione nell’insieme BindingGroup.

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

Esempio

Nell'esempio seguente viene chiamato BeginEdit quando viene caricata una finestra per avviare la transazione di modifica.

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

Commenti

Se le origini del BindingGroup supporto eliminano le modifiche in sospeso, è possibile chiamare BeginEdit per avviare la transazione di modifica, chiamare per salvare le modifiche in sospeso, chiamare CommitEdit CancelEdit per eliminare le modifiche in sospeso.

Per ogni oggetto in Items che implementa IEditableObject, BeginEdit chiama IEditableObject.BeginEdit

Si applica a