Question about operator distance * for XAML with meshes

So, I just wanted to understand why this is happening in my WPF application, as it seems to add a space or a weak line, not wanting this ...

I have the following XAML

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication3.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
<Grid x:Name="LayoutRoot" ShowGridLines="False" Grid.Row="0">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>          
    </Grid.RowDefinitions>
    <Border Grid.Row="0"  CornerRadius="10,10,0,0" Height="10" Background="Black"/>
    <Border Grid.Row="1"  Background="Black">

    </Border>           
    <Border Grid.Row="2" CornerRadius="0,0,10,10" Height="10" Background="Black"/>
</Grid>
<StackPanel Grid.Row="1">
    <Button>Some Button</Button>
</StackPanel>
</Grid>

What does the following window do ...

Window pic

The problem is that if you look closely at the connector of the last line, you will see a faint gray line ...

Faint gray line pic

If, however, I replace <RowDefinition Height="*"/>the internal grid with a fixed pixel size (i.e. <RowDefinition Height="300"/>) the line goes away. Why exactly, when I use the value *, does this add this “gray line” / “space”?

+3
source share
2 answers

,

  • SnapsToDevicePixels = "True"
  • UseLayoutRounding = "False"
  • RenderOptions.EdgeMode = "" alt text
+4

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


All Articles