0

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>
ivaa14
  • 138
  • 10
  • did you try defining a common resource for UniformGrid ... you can make them named as well and local to the xaml file. example with Button https://stackoverflow.com/a/26990535/3225 – kenny Apr 30 '19 at 16:27
  • maybe better https://stackoverflow.com/q/35734912/3225 – kenny Apr 30 '19 at 16:33

0 Answers0