Search code examples
c#uwpparameter-passingback

C# UWP passing Parameter Backward


is there a way to pass data to the previous page when the back button is pressed and the BackRequested command is executed. When navigating forward, I use the following code:

 this.Frame.Navigate(typeof(Warenkorb), groups);

Can someone help me?

Edit:

I tried it with static fields. It is there another way?


Solution

  • The best thing you can do here is to use MVVM paradigm instead of raw code-behind spaghetti. Having MVVM, you're provided with a structured understanding of what's going on in your app, at which state it is right now etc. So, let leave the navigation for the its general purpose - showing and hiding pages. Do not try to put too much over it, keep the app state in MVVM.