0
나는 텍스트 상자가있는 자식이있는 ListView
이 있습니다. 이 텍스트 상자에는 유효성 검사 규칙이 첨부되어 있습니다. 텍스트 상자 중 하나가 유효하지 않을 때 버튼을 사용할 수 없게하는 일종의 바인딩을 만들 수 있습니까?ListView 항목이 유효하지 않은 경우 단추 비활성화
여기에 빠른 예제 :
<Window x:Class="wpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:validationRules="clr-namespace:ValidationRules" Title="MainWindow" Height="350" Width="525">
<DockPanel>
<ListView ItemsSource="{Binding ExampleCollection}">
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn Header="Example">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox>
<TextBox.Text>
<Binding Path="Example" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validationRules:ByteValidationRule/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<Button DockPanel.Dock="Bottom">Save</Button>
</DockPanel>
</Window>
유망 보이는
,하지만 난 내 ListView에있는 텍스트 상자 모두에 결합 할 수있는 방법을 알아낼 수 없습니다. 코드 예제를 제공해 주시겠습니까? – LandonSchropp