In order to add rows to a list view in WPF you'd rather want to bind the
ItemsSource
property of the
ListView
to a collection.
Further you will be able to add items to that collection not just from actual
ListView
UI element, but also from any code behind (2-Way binding will assure you that the items in the UI will get updated).
<ListView Name="ListView1" ItemsSource="{Binding YourCollectionName}">
<ListView.View>
<GridView>
<GridViewColumn Header="Icon" Width="75" DisplayMemberBinding="{Binding Path=Icon}"/>
<GridViewColumn Header="Position" Width="75"/>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
</GridView>
</ListView.View>
</ListView>
Adding items from another window's textbox into your
ListView
will be easily then: you will need to pass your collection object to the second window and manually add items to it.
WPF will take care in updating the UI on the first window.
For details check this:
http://www.switchonthecode.com/tutorials/wpf-tutorial-using-the-listview-part-1[
^]
Regards