无法在 UWP 中设置教学提示的宽度高度 属性

unable to set width height property of Teaching tip in UWP

您好,我正在尝试设置 UWP 的 TeachingTip Class 的宽度和高度。 但它不起作用。任何人都知道发生了什么。这会有所帮助。

unable to set width height property of Teaching tip in UWP

TeachingTip控件会根据内容大小自动设置大小,如需修改请在Content属性中添加一个元素并设置相应的元素尺寸。

<controls:TeachingTip         
    x:Name="ToggleThemeTeachingTip1"
    Title="Change themes without hassle"
    Subtitle="It's easier than ever to see control samples in both light and dark theme!"
    Target="{x:Bind ThemeButton}"
    >
    <controls:TeachingTip.IconSource>
        <controls:SymbolIconSource Symbol="Refresh" />
    </controls:TeachingTip.IconSource>
    <controls:TeachingTip.Content>
        <StackPanel Height="300">
            <TextBlock Text="t's easier than ever to see control samples in both light and dark theme!" TextWrapping="Wrap"/>
        </StackPanel>
    </controls:TeachingTip.Content>
</controls:TeachingTip>

请注意 TeachingTip 控件在其默认设置中有大小限制,有关更多信息,请参阅 this 。 最大值的这些默认值。和最小大小应该被覆盖,以便基于内容的动态大小可以工作:

<x:Double x:Key="TeachingTipMinHeight">40</x:Double>
<x:Double x:Key="TeachingTipMaxHeight">520</x:Double>
<x:Double x:Key="TeachingTipMinWidth">320</x:Double>
<x:Double x:Key="TeachingTipMaxWidth">336</x:Double>