XAML Binding.UpdateSourceTrigger when a Button.Click is fired?
问题 I want to set the UpdateSourceTrigger to an event of a control: <TextBox Text="{Binding Field, UpdateSourceMode=btnOK.Click}"> <Button Name="btnOK"> <Button.Triggers> <Trigger> <!-- Update source --> </Trigger> </Button.Triggers> </Button> I thought about two ways: Set UpdateSourceMode or some other stuff in the binding. Set an EventTrigger that updates source on button click. Possible, or I have to do it with code? 回答1: You'll have to use code. Specifically: Set UpdateSourceTrigger=Explicit