I have created a page where I am showing the api fetched data without refreshing the page by implementing the inotifypropertychanged.
When I am using property _bookQuantity its working fine.
But when I am binding the value of property with formatted string, it's not working, means the data is not changing dynamically.
I want to use formatted string for proper format of data showing in the UI.
Any suggestion?
I am attaching the code here:
public double BookQuantity { get; set; }
public double _bookQuantity //This is showing data and changing dynamically. Working fine.
{
get{return BookQuantity; }
set
{
BookQuantity = value;
OnPropertyChanged();}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public FormattedString FormattedBookQuantity // This is showing data at initial time, but not changing dynamically.
{
get
{
FormattedString fs = new FormattedString();
fs.Spans.Add(StyleClass.GetListLabelNoBold("Book Quantity "));
fs.Spans.Add(StyleClass.GetListLabelNoBold(_bookQuantity.ToString()));
return fs;
}
}