jeudi 27 mai 2021

Checkbox content to be changed while page loading in WPF

I am naïve to WPF .Designed a 50 checkboxes(5 columns and 10 rows like A1,A2,A3...B1,B2,B3..E10) in WPF Application. While page loading, I need to change the checkbox content based on database.(if database status is Enabled, checkbox content changed to Enabled and Color to green, Disabled means checkbox content to Disabled and color to Red ).

I don't know how to assign a content in a checkbox while loading and how to loop over the checkbox names. how to store all the checkbox names into array ?

>  <CheckBox Content="Empty" Foreground="#FFE8D6D6" Height="15"
> HorizontalAlignment="Left" Margin="21,489,0,0" Name="A1"
> VerticalAlignment="Top" Width="59" Click="CheckBox_Click" "/> . . .
>      <CheckBox Content="Empty" Foreground="#FFE8D6D6" Height="15" HorizontalAlignment="Left" Margin="21,489,0,0" Name="E10"
> VerticalAlignment="Top" Width="59" Click="CheckBox_Click" "/>

Any help/idea in appreciated.




Aucun commentaire:

Enregistrer un commentaire