How do I stop binding properties from updating?

后端 未结 3 1515
长发绾君心
长发绾君心 2021-02-06 01:30

I have a dialog that pops up over the main screen (it\'s actually a user control that appears on the page as per the application demo from Billy Hollis) in my application that h

3条回答
  •  遇见更好的自我
    2021-02-06 01:50

    You could use a BindingGroup :

    ...
    
        
            
        
        
        
        

    Code behind :

    private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {
        panel.BindingGroup.BeginEdit();
    }
    
    private void btnSubmit_Click(object sender, RoutedEventArgs e)
    {
        panel.BindingGroup.CommitEdit();
        panel.BindingGroup.BeginEdit();
    }
    
    private void btnCancel_Click(object sender, RoutedEventArgs e)
    {
        panel.BindingGroup.CancelEdit();
        panel.BindingGroup.BeginEdit();
    }
    

提交回复
热议问题