private void ShowResultDialog()
        {
            var adapter = new MvxAdapter(Context, (IMvxAndroidBindingContext)BindingContext)
            {
                ItemsSource    = ViewModel.Characters,
                ItemTemplateId = Resource.Layout.list_item_character_image
            };
            var dialog = new AlertDialog.Builder(Context).SetAdapter(adapter, (IDialogInterfaceOnClickListener)null).Show();

            dialog.ListView.ItemClick += (sender, args) => {
                ViewModel.ViewProfileCommand.Execute(ViewModel.Characters[args.Position]);
            };
        }
Пример #2
0
        public MagicMvxListView(Context context, IAttributeSet attrs, MvxAdapter adapter)
            : base(context, attrs)
        {
            var itemTemplateId = MvxListViewHelpers.ReadAttributeValue(context, attrs,
                                                                       MvxAndroidBindingResource.Instance
                                                                       .ListViewStylableGroupId,
                                                                       MvxAndroidBindingResource.Instance
                                                                       .ListItemTemplateId);

            adapter.ItemTemplateId = itemTemplateId;
            Adapter = adapter;
            SetupItemClickListeners();
        }
Пример #3
0
        public MvxListViewWithHeader(Context context, IAttributeSet attrs) : base(context, attrs, null)
        {
            var headerId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                  AndroidBindingResource.Instance.MvxListViewWithHeader_HeaderLayout);
            var footerId = MvxAttributeHelpers.ReadAttributeValue(context, attrs, MvxAndroidBindingResource.Instance.ListViewStylableGroupId,
                                                                  AndroidBindingResource.Instance.MvxListViewWithHeader_FooterLayout);

            var headers = GetFixedViewInfos(headerId);
            var footers = GetFixedViewInfos(footerId);

            var adapter = new MvxAdapter(context);

            adapter.ItemTemplateId = MvxAttributeHelpers.ReadListItemTemplateId(context, attrs);

            var headerAdapter = new HeaderMvxAdapter(headers, footers, adapter);

            Adapter = headerAdapter;
        }
Пример #4
0
        public MvxListViewWithHeader(Context context, IAttributeSet attrs)
            : base(context, attrs, null)
        {
            IMvxAdapter adapter = new MvxAdapter(context);

            ApplyAttributes(context, attrs);

            var itemTemplateId = MvxAttributeHelpers.ReadListItemTemplateId(context, attrs);

            adapter.ItemTemplateId = itemTemplateId;

            var headers = GetHeaders();
            var footers = GetFooters();

            IMvxAdapter headerAdapter = new HeaderMvxAdapter(headers, footers, adapter);

            Adapter = headerAdapter;
        }