Spacing added when switching control template dynamically
问题 I've implemented switching of TextBox with TextBlock on clicking. My goal was to show ... when the text becomes wider than the TextBox width I've followed this answer to come up with a solution. This is my current code: <TextBox x:Name="TextBox" Height="24" Width="300" Cursor="Hand" BorderThickness="0" Background="White" VerticalAlignment="Center" Text="{Binding MyCustomText}"> <TextBox.Style> <Style TargetType="TextBox"> <Setter Property="Background" Value="Yellow" /> <Style.Triggers>