Are you trying to 'add items to the stackpanel' ?
If so then you can bind the ItemsSource property of the stackpanel to a BindableCollection<TItemType> Property on your view model ...
then set the Button's name to 'AddItem'
in you viewmodel have a public method called AddItem which does just that .. e.g. adds an item to the BindableCollection<TItemType> Property
This will automagically add the item to the stackpanel
Hopefully that's helpful (that's if I've understood what you're trying to do ;-) )