Common.cs 463 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
using System.Windows;

namespace MultiLayout
{
    /// <summary>
    /// 公共类
    /// </summary>
    public static class Common
    {
        public static string GetStringFromResourceDictionary(string key, string defaultValue)
        {
            string value = (string)Application.Current.TryFindResource(key);
            if (value == null)
            {
                return defaultValue;
            }
            return value;
        }
    }
}