How to get ListBox ItemsPanel in code behind
问题 I have a ListBox with an ItemsPanel <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <StackPanel x:Name="ThumbListStack" Orientation="Horizontal" /> </ItemsPanelTemplate> </Setter.Value> </Setter> I am wanting to move the Stack Panel along the X-axis using a TranslateTransform in code behind. Problem is, I can't find the Stack Panel. ThumbListBox.FindName("ThumbListStack") Returns nothing. I want to use it in: Storyboard.SetTarget(x, ThumbListBox.FindName("ThumbListStack"))