У меня есть стиль
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="TextBox" x:Key="AuthTextBox">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Margin" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border CornerRadius="8"
Background="#3e4147">
<Grid>
<TextBlock IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="10,0,0,0"
x:Name="txt"
FontSize="14"
Foreground="DarkGray">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Text, ElementName=MessageBox}" Value="">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
И в моем xaml документе есть
<TextBox Grid.Row="1"
Height="30"
Width="230"
HorizontalAlignment="Center"
Style="{StaticResource AuthTextBox}"
Text="Login">
</TextBox>
Свойство Text в TextBox не работает и мой текст не выводится. Как мне написать в xaml, чтобы оно вывело текст?
PART_ContentHost, который отвечает за отображение текста, собственно, где он у вас? – EvgeniyZ Oct 11 '21 at 19:08