WPF MVVM databinding usercontrol
Bonjour,
j'aimerais savoir comment récupérer les données saisies dans mon usercontrol qui se trouve dans un window?
j'explique: j'ai un UserControl, UserControl1.xaml, son ViewModel , UserControlVM.cs, dans lequel j'ai ceci (en fait j'ai une combobox et des checkbox, mais la je schématise) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| usercontrol1VM.cs
private bool b_isCheckedTest;
public bool IsCheckedTest
{
get
{
return b_isCheckedTest;
}
set
{
if (b_isCheckedTest != value)
{
b_isCheckedTest = value;
RaisePropertyChanged(() => IsCheckedTest);
}
}
}
usercontrol1.xaml
<CheckBox Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="Confirmation visuelle : "
FlowDirection="RightToLeft"
IsChecked="{Binding XPath=IsCheckedTest,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}" />
MainWindow.xaml
<local: usercontrol1 />
MainWindowVM.cs
jeveux recuperer la valeur de mon usercontrol1 |
Merci d'avance de vos réponses :)