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

Best way to iterate through a selection of Xamarin.Forms controls?

$
0
0

Does anyone know a better way to loop through the children of than this:

        void OnSliderValueChanged(object sender, ValueChangedEventArgs args)
        {
            double value = args.NewValue;
            foreach (Label label in A.Children)
            {
                label.HeightRequest = value;
                label.WidthRequest = (value * 4);
                label.FontSize = value;
            }
        }

Can I assign controls to a "class" as in HTML and then iterate through the class members?
Can I refer to the children without specifying their type and just iterate by ordinal position, as in A.Children(5).HeightRequest = value; ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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