Afficher/Masquer un control TexBox en fonction de la valeur de la ComboBox
Bonjour à tous :D
J'ai un projet WPF/MVVM en C#/FrameWork 4.0
Dans ma vue j'ai deux controlBox NoRSAC et LieuRSAC
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <View:StateControlTextBox
x:Name="NoRSAC"
ReadOnly="{Binding IsReadOnly}"
ViewModelDataType="UtilisateurSaisieViewModel"
TableDataType="TUtilisateurDataTable"
Tag="{DynamicResource TELEPHONE}"
Text="{Binding UserVM.No_RSAC, Mode=TwoWay}" Margin="0" Canvas.Top="140" Width="185" VerticalAlignment="Stretch" />
<View:StateControlTextBox
x:Name="LieuRSAC"
ReadOnly="{Binding IsReadOnly}"
ViewModelDataType="UtilisateurSaisieViewModel"
TableDataType="TUtilisateurDataTable"
Tag="{DynamicResource TELEPHONE}"
Text="{Binding UserVM.Lieu_RSAC, Mode=TwoWay}" Margin="0" Canvas.Top="140" Width="185" VerticalAlignment="Stretch"/>
</Canvas> |
et un ControlComboBox "cmbFonction" qui contient des valeurs
Code:
1 2 3 4 5 6 7 8 9
| <View:StateControlComboBox
x:Name="cmbFonction"
ReadOnlyControlState="Disabled"
IsReadOnly="{Binding IsReadOnly}"
ViewModelDataType="UtilisateurSaisieViewModel"
TableDataType="TUtilisateurDataTable"
ItemsSource="{Binding ListeFonctions}"
DisplayMemberPath="DisplayText"
SelectedValue="{Binding UserVM.Fonction, Mode=TwoWay}" Width="303" Margin="0" HorizontalAlignment="Left" Canvas.Left="97" Canvas.Top="108" /> |
Ce que je veux faire : C'est d'afficher les deux controlBox NoRSAC et LieuRSAC en même temps quand je sélectionne la valeur "Agent commercial" dans la ComboBox "cmbFonction" et de les masquer quand c'est une autre valeur sélectionnée
Merci pour votre aide :D