Windows App SDK 1.4 TextBox text is shaky when resizing window

Brian Duffy 30 Reputation points
2023-09-19T00:13:15.77+00:00

I find that when I place a TextBox control inside a <RelatviePanel> and align its sides with the panel the text gets jumpy when I resize the height of the window. If I change the property TextWrapping to "NoWrap" then the problem goes away but I want the text to wrap and be able to resize the window without the text jumping up and down ...

<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="LayoutTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:LayoutTest"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">


    <RelativePanel>
        <TextBox
            Visibility="Visible"
            x:Name="directions"
            TextWrapping= "Wrap" 
            Background="White"
            Foreground="Black"
        
            RelativePanel.AlignRightWithPanel="True"
            RelativePanel.AlignLeftWithPanel="True"
            RelativePanel.AlignTopWithPanel="True"
            RelativePanel.AlignBottomWithPanel="True"

            >
        </TextBox>

    </RelativePanel>
    

</Window>

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
734 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
773 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,503 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xiaopo Yang - MSFT 11,661 Reputation points Microsoft Vendor
    2023-09-19T01:20:00.5066667+00:00

    Hello @Brian Duffy,

    I can reproduce but it could be by design. RelativePanel.Align*WithPanel and Wrap may cause some more calculation which causes the shaky. If I remove all RelativePanel.Align*WithPanel properties, then the problem also goes away.

    You can still submit an issue at https://github.com/microsoft/WindowsAppSDK/issues.


0 additional answers

Sort by: Most helpful