내 FindName
이 작동하지 않습니다. 값은 null입니다.
그리고 호출 할 수 없습니다 내에서 x:Name="QuantiteTextBox"
내 코드 숨김 ...
이름은 .. 이런 맥락에서 존재하지 않는 것 같다FindName이 작동하지 않습니다.
XAML :
<GridViewColumn Width="Auto" Header="Nb">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox x:Name="QuantiteTextBox" Text="{Binding Quantite, ElementName=EditTableUserControl}" HorizontalAlignment="Center" Margin="-10,0,0,0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
WPF :
var quantiteTextBox = (TextBox)FindName("QuantiteTextBox");
어떻게이 문제를 해결할 수 있습니까? 감사.
올바른 창에서 FindName을 사용하고 있습니까? – AgentFire
해결 방법 : http://stackoverflow.com/questions/636383/how-can-i-find-wpf-controls-by-name-or-type/1759923#1759923 FindName의 대안. – C0ZEN