Set resource string to XAML

后端 未结 2 1343
逝去的感伤
逝去的感伤 2020-12-31 10:08

I know how to set string from resource
where Text1.Text is \"Hello\"

But I want to do like this

2条回答
  •  既然无缘
    2020-12-31 11:14

    Nikhil's answer is on the right track, but is right for other platforms.

    For windows 8, you need to do the following in your resource directory:

    This is a resource
    

    In your xaml:

    
    

    In code:

    string myString = (string)(App.Current.Resources["MyString"]);
    

提交回复
热议问题