-2

I want to create a template variable in Xamarin Forms like the ones we can create in Angular.

For example like this

Koushik Sarkar
  • 480
  • 2
  • 6
  • 18

1 Answers1

0

You can use x:Name to name a view then refer to it elsewhere using x:Reference. Like the following:

<Slider x:Name="slider"
        Maximum="360" />

<Label BindingContext="{x:Reference slider}"
      Text="{Binding Value, StringFormat='The angle is {0:F0} degrees'}" />

Here is an article showing this and other binding techniques.

Steve Chadbourne
  • 6,873
  • 3
  • 54
  • 82