title: how to upper/lower case resx bindings in xaml in xamarin.forms?
body: <p>Following <a href="https://developer.xamarin.com/guides/xamarin-forms/advanced/localization/" rel="nofollow noreferrer">xamarin localization topic</a> and sample <a href="https://github.com/xamarin/xamarin-forms-samples/tree/master/TodoLocalized" rel="nofollow noreferrer">TodoLocalized</a>, I made my app multilingual. my problem is sometimes, I need to use sometimes words capitalized and I dont want to create another translation in resx files as upper case version of same word. what is the best way to achieve this? if possible to extend this translateextension? or should I use IValueConvertor? if yes how to bind it in xaml</p>
  
  <pre><code>    // You exclude the 'Extension' suffix when using in Xaml markup
          [ContentProperty("Text")]
          public class TranslateExtension : IMarkupExtension
          {
              readonly CultureInfo ci;
              const string ResourceId = "myApp.Resx.AppRes";
  
              public TranslateExtension()
              {
                  if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
                  {
                      ci = DependencyService.Get&lt;ILocalize&gt;().GetCurrentCultureInfo();
                  }
              }
  
              public string Text { get; set; }
  
              public object ProvideValue(IServiceProvider serviceProvider)
              {
                  if (Text == null)
                      return "";
  
                  ResourceManager resmgr = new ResourceManager(ResourceId
                                      , typeof(TranslateExtension).GetTypeInfo().Assembly);
  
                  var translation = resmgr.GetString(Text, ci);
  
                  if (translation == null)
                  {
  #if DEBUG
                      throw new ArgumentException(
                          String.Format("Key '{0}' was not found in resources '{1}' for culture '{2}'.", Text, ResourceId, ci.Name),
                          "Text");
  #else
                  translation = Text; // HACK: returns the key, which GETS DISPLAYED TO THE USER
  #endif
                  }
                  return translation;
              }
          }
  </code></pre>
  
  <p>my Xaml:</p>
  
  <pre><code>     &lt;Button  Image="ic_add.png"   Text="{resx:Translate AddNew}"
   Command="{Binding AddNew}"   HorizontalOptions="FillAndExpand"/&gt;
  </code></pre>
  
  <p>I tried doing this, but I guess Binding expects a property defined in the BindingContext. therefore it doesnt work but how do I achieve it for a text defined in resx file.</p>
  
  <pre><code>Text="{Binding {resx:Translate AddNew}, Converter={StaticResource UpperCaseConverter}}"
  </code></pre>