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

How to use FlexLayout in a MVVM framework?

$
0
0

I can fill a FlexLayout dynamically with labels from a collection in the code behind like that (labels are wrapped to several rows):

       foreach (WordItem item in _items)
        {
            Label label = new Label
            {
                Text = item.Name,
                Margin = new Thickness(2, 0, 2, 0),
                FontSize = 16,
                TextColor = Color.Black,
                BackgroundColor = Color.AliceBlue
            };

            flex1.Children.Add(label);
        }

But I can't imagine how to do it in a MVVM application (I'm using Prism/DryIoc). What would be the source property for binding dynamically several labels to the FlexLayout?
Every answer is appreciated!
Marc


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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