4
this one과 관련된 질문이 있습니다. StackPanel에 이벤트를 연결하려고하지만 XamlReader를 사용할 때 연결되지 않습니다. ChildItem_Load 메서드를 호출 할 수 없습니다. 누구든지이 일을 할 수있는 방법을 알고 있습니까?생성 된 코드에 이벤트 처리기 연결
이 이벤트 이외의 코드는 정상적으로 작동합니다.
this._listBox.ItemTemplate = (DataTemplate) XamlReader.Load(
@"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Border>
<StackPanel Loaded=""ChildItem_Loaded"">
<TextBlock Text=""{Binding " + this._displayMemberPath + @"}"" />
</StackPanel>
</Border>
</DataTemplate>"
멋진 대답 - 감사합니다! – edtheprogrammerguy