0
textBox1에 대해 DataTrigger
을 구현하고 싶습니다. textBox1 안에 Text
이 "ABC"이면 "일치하는 데이터!"라고 표시하려고합니다. 다른 TextBox
에 말하면, textBox2. 이 xaml 코드 아래에 있지만 작동하지 않는 작성했습니다. 오류 메시지 아래에 있습니다. 이것에 대한DataTriggers : 작동 방식
'Text' member is not valid because it does not have a qualifying type name
XAML 코드는 다음과 같습니다 바인딩에 문제가
<Window x:Class="ControlTemplateDemo.Animation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="Animation" Height="300" Width="607">
<Grid>
<Border Background="White">
<StackPanel Margin="30" HorizontalAlignment="Left" Width="500" Height="209">
<TextBox Name="textBox1">
<TextBox.Triggers>
<DataTrigger Binding="{Binding Path=Text}">
<DataTrigger.Value>
<sys:String>ABC</sys:String>
</DataTrigger.Value>
<Setter TargetName="textBox2" Property="Text" Value="Data matched!"/>
</DataTrigger>
</TextBox.Triggers>
</TextBox>
<TextBox Name="textBox2">
</TextBox>
</StackPanel>
</Border>
</Grid>
</Window>
있습니까?
덕분에, 인 Hemant