Completed
Last Updated: 01 Mar 2018 12:15 by ADMIN
ADMIN
Lance | Senior Manager Technical Support
Created on: 24 Jan 2018 17:06
Category: Entry
Type: Feature Request
1
Entry: Binding Text doesn't update
On Android, when binding the Text value to a view model property, the value doesn't update.

Use the following to reproduce:

// VIEW

<Label Text="RadEntry" />
<telerikInput:RadEntry x:Name="MyRadEntry" 
                       Text="{Binding Username}" 
                       Margin="0,0,0,20"/>
        
<Label Text="Xamarin.Forms Entry" />
<Entry Text="{Binding Username}"/>

// VIEW MODEL

public class ViewModel : NotifyPropertyChangedBase
{
    private string username = "initial";
    private int counter;

    public ViewModel()
    {
        Device.StartTimer(TimeSpan.FromMilliseconds(500), (() =>
        {
            counter++;
                
            Device.BeginInvokeOnMainThread(() =>
            {
                Username = $"{counter}";
            });
                
            return counter < 100;
        }));
    }

    public string Username
    {
        get { return username; }
        set { username = value; OnPropertyChanged();}
    }
}


 Update: Available in R1 2018 SP release.
1 comment
ADMIN
Pavel R. Pavlov
Posted on: 25 Jan 2018 09:01
Try binding in TwoWay mode. It seems the default mode of the Binding is OneWay.