public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); base.OnCreateView(inflater, container, savedInstanceState); Inflater = inflater; // Inflate the layout containing a title and body text. View view = inflater.Inflate(Resource.Layout.PhotoFragment, container, false); //if (Photos == null) { // Photos = new List<PhotoData>(); //} var attendanceLastUUID = Arguments.GetString(C_ATTENDANCE_LAST_UUID); var attendanceLast = string.IsNullOrEmpty(attendanceLastUUID) ? null : MainDatabase.GetEntity <Attendance>(attendanceLastUUID); Photos = (attendanceLast == null) ? new List <PhotoData>() : MainDatabase.GetDatas <PhotoData>(attendanceLastUUID) ?? new List <PhotoData>(); PhotoTable = view.FindViewById <LinearLayout>(Resource.Id.pfPhotoTableLL); RefreshPhotoList(); Brand = view.FindViewById <Spinner>(Resource.Id.pfBrandS); Brands = MainDatabase.GetItems <DrugBrand>(); PhotoType = view.FindViewById <Spinner>(Resource.Id.pfPhotoTypeS); PhotoTypes = MainDatabase.GetItems <PhotoType>(); AddPhoto = view.FindViewById <Button>(Resource.Id.pfAddPhotoB); AddPhoto.Click += (object sender, EventArgs e) => { // if (Common.CreateDirForPhotos(user)) { // string type = photoTypes[spnPhotoTypes.SelectedItemPosition].name; // type = Transliteration.Front(type, TransliterationType.Gost).Substring(0, Math.Min(5, type.Length)).ToUpper(); // string subtype = currentPhotoSubTypes[spnPhotoSubTypes.SelectedItemPosition].name; // subtype = Transliteration.Front(subtype, TransliterationType.Gost).Substring(0, Math.Min(5, subtype.Length)).ToUpper(); string stamp = DateTime.Now.ToString(@"yyyyMMddHHmmsszz"); File = new Java.IO.File(Helper.PhotoDir, string.Format("PHOTO_{0}.jpg", stamp)); var intent = new Intent(MediaStore.ActionImageCapture); intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(File)); StartActivityForResult(intent, C_REQUEST_PHOTO); // } }; Locker = view.FindViewById <TextView>(Resource.Id.locker); Arrow = view.FindViewById <ImageView>(Resource.Id.arrow); if (attendanceLast != null) { if (attendanceLast.When.Date == DateTimeOffset.UtcNow.Date) { Arrow.Visibility = ViewStates.Gone; Locker.Text = string.Empty; } } return(view); }