How to get the value from a resource dictionary (XAML) in C#

前端 未结 1 1187
陌清茗
陌清茗 2021-01-14 13:09

I\'m working on a WPF-application in which the user can change the language (not the current culture!) at runtime. So i have multiple resource dictionaries of type XAML to w

相关标签:
1条回答
  • 2021-01-14 14:06

    To look up app-wide resources from code, use Application.Current.Resources to get the app's resource dictionary, as shown here:

    string insertFirstName = Application.Current.Resources["insert_first_name"];
    

    Source

    0 讨论(0)
提交回复
热议问题