Wpf application variable not changing

Posted by Hasan Zubairi on Stack Overflow See other posts from Stack Overflow or by Hasan Zubairi
Published on 2012-04-08T11:26:58Z Indexed on 2012/04/08 11:29 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

In my application I need some variables on almost all the pages so I declared them in Application.xaml like

<sys:String x:key="First">First</sys:String>

and on one page I change the value in code like Resources["First"] = "This is First";

on the second page when I call the variable like

String f = (string)this.TryFindResource("First");
MessageBox.Show(f);

the out put is "First" and not "This is First". I also tried like.

Application.Current.Properties["First"]

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf