Is there a way to apply a shader effect to a specific grid cell

Is there a way to apply a shader effect to a specific grid cell.

BR

+3
source share
1 answer

You cannot apply a shader effect to a specific Grid cell, but you can add a Rectangle or Border element in a panel (such as a Grid) to get the desired effect you are looking for. Remember to add a Rectangle first or play with ZIndex as shown below so that your code does not hide any controls.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Rectangle Grid.Column="0" Grid.Row="1" Panel.ZIndex="0" >
            <Rectangle.Style>
                <Style TargetType="{x:Type Rectangle}">
                    <Setter Property="Fill" Value="Blue"/>
                </Style>
            </Rectangle.Style>
        </Rectangle >
        <TextBox Grid.Column="0" Grid.Row="1" Height="25" Margin="10" Text="Test 123" Panel.ZIndex="1" />
    </Grid>
+1
source

Source: https://habr.com/ru/post/1759284/


All Articles