How to set different border thickness around UniformGrid in WPF?

178 Views Asked by At

I am writing a sudoku application in WPF and I am using a 4x4 UniformGrid which has four smaller 2x2 UniformGrids inside of it. Every grid cell contains a textbox in which the number will be inputted. I need to make the outside of all borders thicker. For example, I would like to set the outside border thickness of the main grid to 3.

I need to create the style in App.xaml file and then use it on the UniformGrid components. I have already tried with a Rectangle, but I cannot make it work. So any hints are appreciated.

Here is the code I used to create the grid.

<Grid>
        <UniformGrid Name="mainGrid">
             <UniformGrid Name="grid1">
                <TextBox Name="tb0"/>
                <TextBox Name="tb1"/>
                <TextBox Name="tb2"/>
                <TextBox Name="tb3"/>
            </UniformGrid>
            <UniformGrid Name="grid2">
                <TextBox Name="tb4"/>
                <TextBox Name="tb5"/>
                <TextBox Name="tb6"/>
                <TextBox Name="tb7"/>
            </UniformGrid>
            <UniformGrid Name="grid3">
                <TextBox Name="tb8"/>
                <TextBox Name="tb9"/>
                <TextBox Name="tb10"/>
                <TextBox Name="tb11"/>
            </UniformGrid>
            <UniformGrid Name="grid4">
                <TextBox Name="tb12"/>
                <TextBox Name="tb13"/>
                <TextBox Name="tb14"/>
                <TextBox Name="tb15"/>
            </UniformGrid>
        </UniformGrid>
    </Grid>
0

There are 0 best solutions below