StackPanel的底部边框

uSe*_*AhA 0 .net c# xaml

如何使StackPanel具有底边框并且厚度为1?

我尝试了几种方法,其中一种方法是下面但我没有尝试过任何工作(包括我在SO上找到的一些答案):

    <Border BorderBrush="#FF1986D1" BorderThickness="1" VerticalAlignment="Bottom">
        <StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="13">


        </StackPanel>            
    </Border>
Run Code Online (Sandbox Code Playgroud)

uSe*_*AhA 6

我想到了:

<Window x:Class=".MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="" Height="558" Width="328">
    <Grid>
        <Border BorderBrush="#FF1986D1" BorderThickness="0 0 0 1" VerticalAlignment="Top">
            <StackPanel Background="#FFC6E1EE" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="113">

            </StackPanel>            
        </Border>
    </Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)