Skip to content

Instantly share code, notes, and snippets.

@tomwis
Created December 17, 2017 13:13
Show Gist options
  • Save tomwis/9f1d6f612aca75af68bf2d0b017f89be to your computer and use it in GitHub Desktop.
Save tomwis/9f1d6f612aca75af68bf2d0b017f89be to your computer and use it in GitHub Desktop.
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