I found how to do it whilst reading this article:
All it takes is declaring a WrapPanel variable at the start of your code:
private WrapPanel wp = new WrapPanel();
And then hooking into the WrapPanel that already exists in your XAML, and accessing the Loaded event and casting the WrapPanel to tge variable just created:
private void wp_Loaded(object sender, RoutedEventArgs e)
wp = sender as WrapPanel;
Alot easier than I thought!