How to pass values between two pages in WPF

后端 未结 4 1403
春和景丽
春和景丽 2021-01-02 08:41

what is the best practice to pass values between pages in WPF?

thanks

4条回答
  •  甜味超标
    2021-01-02 09:11

    Your fixed point of reference is the Application object. You can store stuff in the Properties collection:

     string myText = (string)Application.Current.Properties["test"];
    

    Or you can add any kind of data to your derived App class.

提交回复
热议问题