"How can I pass a parameter from my mainpage.xaml or mainpage.cs, to app.cs? "
You can create a public property in your App.cs, something like:
public int ItemId {get; set;}
As the App context is available everywhere, you can access it via your MainPage.cs.
App.ItemId = your ID here