public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            addNewPostButton  = view.FindViewById <Button>(Resource.Id.addNewPostButton);
            addCategoryButton = view.FindViewById <Button>(Resource.Id.addCategoryButton);
            mvxSpinner        = view.FindViewById <MvxAppCompatSpinner>(Resource.Id.allCategoriesSpinner);
            inputTitle        = view.FindViewById <EditText>(Resource.Id.inputTitle);
            inputPostContent  = view.FindViewById <EditText>(Resource.Id.inputPostContent);
            inputPostContent.VerticalScrollBarEnabled = true;
            inputPostContent.MovementMethod           = new ScrollingMovementMethod();
            inputNickName        = view.FindViewById <EditText>(Resource.Id.inputNickName);
            inputPostDescription = view.FindViewById <EditText>(Resource.Id.inputPostDescription);
            inputPostDescription.VerticalScrollBarEnabled = true;
            inputPostDescription.MovementMethod           = new ScrollingMovementMethod();
            //categoryId= mvxSpinner.GetItemIdAtPosition(mvxSpinner.SelectedItemPosition);
            //categoryId = mvxSpinner.s;
            var set = this.CreateBindingSet <CreatePostView, CreatePostViewModel>();

            set.Bind(inputTitle).To(vm => vm.Title);
            set.Bind(inputPostContent).To(vm => vm.PostContent);
            set.Bind(inputNickName).To(vm => vm.NickName);
            set.Bind(inputPostDescription).To(vm => vm.Description);
            set.Bind(addCategoryButton).To(vm => vm.OpenDialogCommand);
            // set.Bind(addNewPostButton).To(vm => vm.AddNewPostCommand);
            //set.Bind(categoryId).To(vm => vm.SelectedCategoryId);
            set.Apply();
            addNewPostButton.Click += addNewPostButton_OnClick;
            return(view);
        }
Beispiel #2
0
 public MvxAppCompatSpinnerSelectedItemBinding(MvxAppCompatSpinner spinner)
     : base(spinner)
 {
 }
 public static string BindSelectedItem(this MvxAppCompatSpinner mvxAppCompatSpinner)
 => MvxAppCompatPropertyBinding.MvxAppCompatSpinner_SelectedItem;