Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Sometimes pickers and entry fields IsVisible option not working

$
0
0

I have an content page that contain a registration form,and this page controled by a configuration page(visible,editable,disable). so when this page load the configuration data,few times disable option not woking.and in that case form fields loaded incorrectly.

if (!string.IsNullOrEmpty(PriorityValue))
                    {
                        if (PriorityValue == "Editable")
                        {
                            Priority.IsEnabled = true;
                            PriorityLbl.IsVisible = true;
                        }
                        else if (PriorityValue == "ReadOnly")
                        {
                            Priority.IsEnabled = false;
                            PriorityLbl.IsVisible = true;
                        }
                        else
                        {
                            Priority.IsVisible = false;
                            PriorityLbl.IsVisible = false;
                        }
                    }

after put this code under:

 Device.BeginInvokeOnMainThread(() =>
                    {
                Priority.IsEnabled = true;
                                PriorityLbl.IsVisible = true;
            });

Then it will works fine.

so is it a good solution for controling visibility for each fields?


Viewing all articles
Browse latest Browse all 204402

Trending Articles