WPF UpdateSourceTrigger的使用
<Window x:Class="XamlTest.Window8"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window8" Height="300" Width="300">
<Grid>
<StackPanel>
</StackPanel>
</Grid>
</Window>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window8" Height="300" Width="300">
<Grid>
<StackPanel>
<TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
// PropertyChanged:更改后直接更新源
<!--<TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=LostFocus}"></TextBox>-->
// LostFocus:失去焦点后更新源
<!--<TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=Explicit}"></TextBox>-->
// Explicit:不更新源
</StackPanel>
</Grid>
</Window>