예제 #1
0
        /// <summary>
        /// See <see cref="MarkupExtension.ProvideValue" />
        /// </summary>
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            var binding = new Binding("Value")
            {
                Source = TranslationData.GetTranslationData(_key, _args)
            };

            return(binding.ProvideValue(serviceProvider));
        }
예제 #2
0
 public static TranslationData GetTranslationData(MultistringTag key, string args = "")
 {
     lock (_locker)
     {
         if (key == null || string.IsNullOrWhiteSpace(key.Value))
         {
             return(new TranslationData(key, args));
         }
         else if (!Cache.ContainsKey(key.Value + args))
         {
             var translationDate = new TranslationData(key, args);
             Cache.Add(key.Value + args, translationDate);
             return(translationDate);
         }
         return(Cache[key.Value + args]);
     }
 }