KeyToStringConvert.cs 629 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ivf_tl_Manage.Converts
  7. {
  8. public static class KeyToStringConvert
  9. {
  10. public static string GetLanguageStringByKey(string key)
  11. {
  12. try
  13. {
  14. if (App.Current == null) return "";
  15. object value = App.Current.TryFindResource(key);
  16. return value == null ? "" : value.ToString();
  17. }
  18. catch (Exception)
  19. {
  20. return "";
  21. }
  22. }
  23. }
  24. }