Hello,
Welcome to Microsoft Q&A,
Invalid binding path 'sys:String.Format('{0} is now available in {0}', First,Second )' : Invalid or missmatched parameter at position '1'.
I reproduce the compiler error, and there are two problems by testing.
- The type of
First
should bestring
based on the sentense “The argument types need to match the data being passed in – we don’t do narrowing conversions” in the document. - Add
x:Null
into theString.Format()
and the binding statement will work.
For example:
Add to the MainPage:
<TextBlock x:Name="textBlock" Text="{x:Bind sys:String.Format(x:Null,'{0}-{1}',local:MainPage.First,local:MainPage.Second)}"/>
And the following code-behind:
public static string First => "1";
public static string Second => "2";
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.