Поместите текст содержимого в центр внутри обучающей подсказки - PullRequest
0 голосов
/ 09 июля 2020

Я использую элемент управления обучающими подсказками из WinUi 2.4 в UWP, я хочу разместить контент в центре обучающей подсказки, но я не могу разместить содержимое в центре. Я не предоставляю никакого заголовка, подзаголовок. Найдите прикрепленное изображение. Можно ли сделать значок закрытия невидимым.

<winui:TeachingTip x:Name="ToggleThemeTeachingTip2"
                    IsOpen="True"                        
                    PreferredPlacement="Bottom"
                    PlacementMargin="30"                                 
                    Background="Green" Foreground="White"  
                                   
                    >
                    <winui:TeachingTip.Content>
                        <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"   Text="Content of the teaching tip"></TextBlock>
                    </winui:TeachingTip.Content>
                </winui:TeachingTip>
                

введите описание изображения здесь

1 Ответ

0 голосов
/ 09 июля 2020

enter image description here

This is not the cleanest solution, but doesn't take much effort and works pretty well. Just add negative margin to the content element (TextBlock in your case):

<TextBlock Margin="0,-40,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"   Text="Content of the teaching tip"></TextBlock>
...