Skip to content

Instantly share code, notes, and snippets.

@tomwis
Created Dec 17, 2017
Embed
What would you like to do?
var picker = new Picker()
{
DisplayPropertyName = nameof(PickerItem.DisplayName), // we właściwości DisplayName mamy nazwę pliku z obrazkiem lub nazwę z Asset Catalogu
ContentType = PickerDisplayContentType.Image, // Domyślna wartość to PickerDisplayContentType.Text
ContentImageSize = new CGSize(32, 32), // Domyślna wartość to 32x32
ContentImageAlignment = UIControlContentHorizontalAlignment.Center // Domyślna wartość to UIControlContentHorizontalAlignment.Left
};
Add(picker);
var set = this.CreateBindingSet<MyView, MyViewModel>();
set.Bind(picker).For(v => v.ItemsSource).To(vm => vm.PickerItems);
set.Bind(picker).For(v => v.SelectedItem).To(vm => vm.SelectedItem).TwoWay();
set.Apply();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment