Reputation: 3492
In my page.xaml has the declaration as follows
<Label Text="Location" Style="{StaticResource labelStyle}" />
<ContentView Style="{StaticResource fieldView}">
<Label Text="{Binding Title}" Style="{StaticResource fieldStyle}" />
</ContentView>
I am trying to access the variable Location.Text in xaml.cs page. However, I couldn't access the syntax.
Upvotes: 0
Views: 171
Reputation: 89204
You need to assign a name to an element to access it from the code behind:
in the XAML:
<Label x:Name="txtLoc" Text="Location" Style="{StaticResource labelStyle}" />
in the code behind:
var loc = txtLoc.Text;
Upvotes: 1