A Microsoft platform for building and publishing apps for Windows devices.
Hi,
Welcome to Microsoft Q&A!
To store values between pages, it is recommended to achieve a static Dictionary in App class. As follows:
App.xaml.cs:
sealed partial class App : Application
{
public static Dictionary<int, string> Dic;
public App()
{
this.InitializeComponent();
Dic = new Dictionary<int, string>
{
{1,"Tom" },
{2,"Jack"},
{3,"Lily"}
};
this.Suspending += OnSuspending;
}
………
}
If you want access the value, you only need to call App.Dic[key], such as App.Dic1, which value is “Tom”.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.