Simple binding in XAML

Hash6Hash6 USMember

Hello. I have question about binding in Xamarin. I'm trying to do it the simplest way and I don't know why isn't it working.

XAML:
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyNamespace.SimplePage"> <Label Text="{Binding MyString}"/> </ContentPage>

XAML.CS:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace MyNamespace { public partial class SimplePage : ContentPage { public string MyString { get; set; } public SimplePage () { InitializeComponent(); MyString = "Any text"; } } }

Best Answer

Answers

Sign In or Register to comment.