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

C# Xamarin How to update a static string in a label

$
0
0

i want to update a label with a static string. Thats my actual Code

public partial class MainPage : INotifyPropertyChanged
{
private static String _uploadstring;
///


/// A static property which you'd like to bind to
///

public static String Uploadstring
{
get
{
return _uploadstring;
}

    set
    {
        _uploadstring = value;

    }
}

and i want call it with

    Device.BeginInvokeOnMainThread(async () =>
    {
        Uploadstring = "TEEEEEEST";
    });

here is my XAML Binding

   <Label Text="{Binding Source={x:Staticlocal:MainPage.UploadString}}" x:Name="ttts"  TextColor="Red" TranslationY="50" HeightRequest="30" FontSize="26" HorizontalOptions="Center"/>

If i set i breakpoint i see that the Uploadstring is updated in my XAML. But he dont display it because he dosent update the text. How can i solve my problem?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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