Rather than creating an instance of your mainpage, you can pass the mainpage as an argument to the usercontrol and do it like below,
Usercontrol(Mainpage m);
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
m.openApplication("STOCK");
}
Creating an instance will make null references if values are not assigned.