I want to center and stretch checkbox in UniformGrid's cell.
I've tried to do it in many ways:
<UniformGrid>
<CheckBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" />
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="True" />
<CheckBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="True" />
but it doesn't satisfy me because I want to stretch (just like in cell (0,0)) and center (just like in (1,0)) those checkboxes in their cells simultaneously.
How can I do it?
[edit 1]
I'm trying to make it so that I don't have to click the little check but instead can click the entire cell.
[edit 2]
Actually I want to add those checkboxes from C# code so if solution made in XAML is not 'portable' to C# language it will be not very helpful.