BindingGroup.CommitEdit 메서드

정의

모든 ValidationRule 개체를 실행하고 모든 유효성 검사 규칙이 성공하는 경우 바인딩 소스를 업데이트합니다.

public:
 bool CommitEdit();
public bool CommitEdit ();
member this.CommitEdit : unit -> bool
Public Function CommitEdit () As Boolean

반환

Boolean

모든 ValidationRule이 성공하고 값이 소스에 커밋되면 sources;true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 CommitEdit 보류 중인 변경 내용 및 다음 호출을 저장 하려면 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

설명

모든 경우 ValidationRule 성공 하면 원본 개체를 계속할 수 있는 경우이 방법을 사용 하면 소스입니다. 보류 중인 변경 내용을 커밋하고 편집 트랜잭션을 종료 합니다.

각 개체에 대해 Items 구현 하는 IEditableObject, CommitEdit 호출 IEditableObject.EndEdit

적용 대상