首页 > 解决方案 > 无法在 UWP 中设置教学提示的宽度高度属性

问题描述

嗨,我正在尝试设置宽度,即 UWP 教学提示类的高度。但它不起作用。任何人都知道发生了什么。这会有所帮助。

标签: uwpwindows-community-toolkit

解决方案


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

TeachingTip控件会根据内容大小自动设置大小,如果要修改它,请在Content属性中添加元素并设置相应大小的元素,请注意教学提示有大小限制更多请参考this

<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>

推荐阅读