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

How to change Text Atribute of Label using FadeTo Method when a Toggle Control in View is pressed

$
0
0

Hello everyone, this is my very first question, i just suscribed, I am using MVVM pattern and i need to change the Text value of a label in my View, when i press a toggle control. The thing is, when i switch between two values of text, the label shows a kind of unwanted blink before take the new value, according to this, i was wondering if using FadeTo method, i could avoid this effect of blink. Please, any idea on how to achieve this would be very appreciated. thanks in advance.

public bool KgToggled
{
get
{
ModifyTextAmount(_kgToggled);
return _kgToggled;
}
set => SetProperty(ref _kgToggled, value);
}

    private void ModifyTextAmount(bool flag)
    {
        TextLabelKg = flag ? "By Kg" : "By Head";
        Amount = flag ? Price * Kg : Price * Heads;
    }

Viewing all articles
Browse latest Browse all 89864

Trending Articles



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