vendredi 9 juillet 2021

Prevent Checkobx from User action WPF

I have a application which shows an user and the attributes of an user. I am showing the attribute "is Admin" in a checkbox s0 if he is an admin then the chebox is checked and if not then it isnt.

This is my XAML code

<CheckBox IsChecked="{Binding LoadedUser.IsAdmin, Mode=OneWay}" Margin="5,7,0,0"/>

As it should only show if the user is admin or not you shouldnt be able to check or uncheck the Checkbox. Is there any possibility to "block" or "protect" the Checkbox from clicks by the user ?




Aucun commentaire:

Enregistrer un commentaire