ListBoxの各項目にボタンがあるので、Binding.UpdateSourceTriggerがExplicitであるデータ項目のすべてのテキストボックスを設定しました。UpdateSourceTrigger = ListBoxなどのItemsコントロールに明示的に使用
ボタンのクリックにハンドラを追加しましたが、今は何ですか?
コントロールから情報を収集するにはどうすればよいですか?彼らは動的なキーを持っていない、どのようにBindingExpressionsを取得するのですか?
<ListBox ItemsSource="{Binding Path=Phones}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type data:Phone}">
<StackPanel Style="{StaticResource StackPanelStyle}">
<TextBox Margin="5" VerticalAlignment="Center" Name="tbNumber"
Text="{Binding Number, ValidatesOnExceptions=True, UpdateSourceTrigger=Explicit}"
/>
<Button Click="btnSavePhone_Click" Margin="5"
Content="_Update" IsEnabled="{Binding IsValid}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
設定方法のサンプルコードを追加できますか? –