Question: In C I could write a plugin by having a shared library implement the following interface:

```
extern "C" int initialize(SomeArgument * state);
extern "C" int shutdown(SomeArgument * state);

```

Obviously this is a *very* high level interface, but I think it gets the point across. I've heard that a good use of reflection is to write plugins, but why would that be superior to what I have here? Using an interface like this gives the following advantages:

* faster (reflection isn't fast, both looking up methods and calling indirectly)
* memory (reflection has memory overhead)
* straight-forward (entry/exit points for the plugin are intuitively obvious)

Am I just missing something?

Answer: 
Try this,

```
DataGridRow row = (DataGridRow)grid.ItemContainerGenerator.ContainerFromIndex(index);
        if (row == null)
        {
                          grid.UpdateLayout();
            grid.ScrollIntoView(grid.Items[index]);
            row = (DataGridRow)grid.ItemContainerGenerator.ContainerFromIndex(index);
        }

```
In addition to other answers: items aren't available in constructor of the control class (page / window / etc).

If you want to access them after created, use `Loaded` event:

```
public partial class MyUserControl : UserControl
{
    public MyUserControl(int[] values)
    {
        InitializeComponent();

        this.MyItemsControl.ItemsSource = values;

        Loaded += (s, e) =>
        {
            for (int i = 0; i < this.MyItemsControl.Items.Count; ++i)
            {
                // this.MyItemsControl.ItemContainerGenerator.ContainerFromIndex(i)
            }
        };
    }
}

```