What is the use of Type.InvokeMember

201 Views Asked by At

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 ?

0

There are 0 best solutions below