public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (myView == null) { myView = inflater.Inflate(Resource.Layout.SelectFriendSourceLayout, container, false); var rootView = myView.FindViewById <LinearLayout> (Resource.Id.linearLayout1); var friendList = Utility.CreateListView("Select Friend", rootView, Resources, inflater); ((POPpicApplication)this.Activity.Application).GetGameRepository(this.Activity).ContinueWith(r => { this.viewModel = new SelectFriendViewModel(r.Result); viewModel.InitializeAsync().ContinueWith(t => { if (!t.IsFaulted && t.Result) { this.Activity.RunOnUiThread(() => { listAdapter = new AndroidFriendListAdapter(this.Activity, viewModel); listAdapter.FriendSelected += (object sender, FriendViewModel e) => { if (this.FriendSelected != null) { this.FriendSelected(sender, e); } }; friendList.Adapter = listAdapter; }); } }); }); } return(myView); }
public SelectFacebookFriendDialogViewController(SelectFriendViewModel viewModel) : base(UITableViewStyle.Plain, null, true) { this.viewModel = viewModel; this.EnableSearch = true; this.SearchPlaceholder = "Search"; }
public AndroidFriendListAdapter(Activity context, SelectFriendViewModel model) { this.context = context; this.model = model; }