private static void SetTextViewTextInner(int textViewId, TextView textView, IMvxLanguageBinder languageBinder, string key) { if (textView == null) { MvxBindingTrace.Trace(MvxTraceLevel.Error, "textView not found for binding " + textViewId); return; } textView.Text = languageBinder.GetText(key).Replace("\r", "\n"); }
private object ConvertValue(object value, object parameter) { IMvxLanguageBinder textProvider = value as IMvxLanguageBinder; TouchAssetPlugin assetPlugin = MvvmCross.Mvx.Resolve <IAssetPlugin>() as TouchAssetPlugin; if (value != null && parameter != null) { try{ //split the text and font definition var values = parameter.ToString().Split(';'); return(assetPlugin.ParseToAttributedText(textProvider.GetText(values[0]), assetPlugin.GetFontByName(values[1]))); }catch (Exception e) { MvxBindingLog.Error("Problem parsing binding {0}", e.ToLongString()); } } return(null); }
/// <summary> /// Sets the TextView text to a localized version of <paramref name="key"/>. /// </summary> public static void SetText(this TextView view, IMvxLanguageBinder languageBinder, string key) { view.Text = languageBinder.GetText(key).Replace("\r", "\n"); }
public string GetText(string entryKey) => _languageBinder.GetText(entryKey);