TextBoxes や ComboBoxes などのいくつかの入力コントロールを含む WPF に ContentControl があります。これらの各コントロールは、ViewModel の特定のプロパティにデータバインドされていUpdateSourceTrigger=Explicit
ます。
FormularioPaciente
「送信」ボタンをクリックすると、バインディングを持つすべての子をトラバースし、次のように呼び出しUpdateSource
ます。
private void btnSalvarEditarPaciente_Click(object sender, System.Windows.RoutedEventArgs e) {
foreach (var childControl in LogicalTreeHelper.GetChildren(FormularioPaciente)) {
// what should I do now?
// I would really like to "auto-find" everything that should be updated...
}
}