從函式中評估 xBind

在 v1607(Redstone 1)之後,此功能被新增到 Bind 標記擴充套件中。
你可以指定函式路徑,以及 arg 路徑和常量 args。假設我們在我們的反碼中定義了一個函式:

public string Translate(string text, string from, string to)

現在我們可以使用 bind 來將函式計算到我們想要的元素中:

<TextBlock Name="SomeText" Text="How are you?" />
<TextBlock Name="{x:Bind Translate(SomeText.Text, 'en', 'es')}" />

函式和 arg 路徑也可以包含點和強制轉換。