Esempio n. 1
0
        void Adapter_ItemClick(object sender, RecyclerClickEventArgs e)
        {
            //Toast.MakeText(Context, "Clicked.", ToastLength.Short).Show();
            var user = ViewModel.Conversations[e.Position].OtherUser;

            FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicMessageFragment.NewInstance(Newtonsoft.Json.JsonConvert.SerializeObject(user)))
            .AddToBackStack(null).Commit();
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            View view = inflater.Inflate(Resource.Layout.basic_fragment_user_profile, null);

            var user = Newtonsoft.Json.JsonConvert.DeserializeObject <User>(Arguments.GetString("userData"));

            Activity.Title = "User Profile";

            fullName   = view.FindViewById <TextView>(Resource.Id.text_full_name);
            userName   = view.FindViewById <TextView>(Resource.Id.text_username);
            messageBtn = view.FindViewById <Button>(Resource.Id.btn_message);

            fullName.Text = user.FirstName + " " + user.LastName;
            userName.Text = "@" + user.Username;

            messageBtn.Click += (sender, e) =>
            {
                FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, BasicMessageFragment.NewInstance(Newtonsoft.Json.JsonConvert.SerializeObject(user)))
                .AddToBackStack(null).Commit();
            };

            return(view);
        }