public static string CompileToJavascript(Expression binding, DataContextStack dataContext) { var translator = new JavascriptTranslator(); translator.DataContexts = dataContext; var script = translator.Translate(binding).Trim(); if (binding.NodeType == ExpressionType.MemberAccess && script.EndsWith("()", StringComparison.Ordinal)) script = script.Remove(script.Length - 2); return script; }
public static JsExpression CompileToJavascript(Expression binding, DataContextStack dataContext, IViewModelSerializationMapper mapper) { var translator = new JavascriptTranslator(dataContext); var script = translator.Translate(binding); //if (binding.NodeType == ExpressionType.MemberAccess && script.EndsWith("()", StringComparison.Ordinal)) script = script.Remove(script.Length - 2); script.AcceptVisitor(new JsViewModelPropertyAdjuster(mapper)); return(script); }
public static string CompileToJavascript(Expression binding, DataContextStack dataContext) { var translator = new JavascriptTranslator(); translator.DataContexts = dataContext; var script = translator.Translate(binding).Trim(); if (binding.NodeType == ExpressionType.MemberAccess && script.EndsWith("()", StringComparison.Ordinal)) { script = script.Remove(script.Length - 2); } return(script); }