WPF弹出窗口仅在底部有圆角

时间:2017-07-22 14:41:48

标签: c# wpf visual-studio-2008 popup .net-3.5

我想知道是否可以将圆角应用于WPF弹出底角。

我知道可以将圆角应用于所有WPF弹出角,例如this,但仅适用于我不确定的角落。那有可能吗?如果是的话,你能提供一个小例子吗?

1 个答案:

答案 0 :(得分:1)

我根据需要提供模板自定义

<Style x:Key="PopupContentStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Border BorderBrush="Gray" BorderThickness="2" 
                         CornerRadius="0,0,20,20" Width="60" Height="60">

                        </Border>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

然后

   <Popup>
        <ContentControl Style="{StaticResource PopupContentStyle}">

        </ContentControl>
    </Popup>
相关问题