Reputation: 147
Iam working in a WPF Application and in one place I had to use this piece of code to get the reference to a VirtualizingStackPanel.
Following is the piece of code,
VirtualizingStackPanel vsp = (VirtualizingStackPanel)obj.InvokeMember("_itemsHost", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, null, content, null);
vsp.SetVerticalOffset(_SomeSelectedIndex);
Can someone explain what exactly this lines do and what are those binding flags ?
Upvotes: 0
Views: 209