Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Label in View not updating from the View Model

$
0
0

I have a label in my View (WelcomePage.xaml):

    <Label Style="{StaticResource Paragraph}" Text ="{Binding WelcomeText, Mode=TwoWay}" HorizontalOptions="Center"/>

Under the WelcomeViewModel Constructor I set the welcome text.

        WelcomeText = Settings.WelcomeText;

it is a fully backed property (WelcomeViewModel.cs):
public class WelcomeViewModel : BaseViewModel
{
private string _welcomeText;
public string WelcomeText
{
get { return _welcomeText; }
set { SetProperty(ref _welcomeText, value); }
}

Changing Settings.WelcomeText does not update the View because the VM constructor is only called once.
Where do I set the WelcomeText binding?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>