public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null);

            CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly);

            readOnly.SetOnCheckedChangeListener(this);

            dataForm = new RadDataForm(Activity);
            layoutRoot.AddView(dataForm, 0);

            person = new Person();
            person.AddPropertyChangedListener(this);

            dataForm.Entity = person;

            //RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
            //validator.Max = new Java.Lang.Integer(30);
            //validator.Min = new Java.Lang.Integer(18);

            Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner);

            commitModes.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, CommitMode.Values());
            commitModes.OnItemSelectedListener = this;

            personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText);

            commitButton        = (Button)layoutRoot.FindViewById(Resource.Id.manualCommit);
            commitButton.Click += (object sender, EventArgs e) => dataForm.CommitChanges();

            return(layoutRoot);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_features, null);

            CheckBox readOnly = (CheckBox)layoutRoot.FindViewById(Resource.Id.readOnly);
            readOnly.SetOnCheckedChangeListener(this);

            dataForm = new RadDataForm (Activity);
            layoutRoot.AddView (dataForm, 0);

            person = new Person();
            person.AddPropertyChangedListener(this);

            dataForm.Entity = person;

            //RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
            //validator.Max = new Java.Lang.Integer(30);
            //validator.Min = new Java.Lang.Integer(18);

            Spinner commitModes = (Spinner)layoutRoot.FindViewById(Resource.Id.commitModeSpinner);
            commitModes.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, CommitMode.Values());
            commitModes.OnItemSelectedListener = this;

            personText = (TextView)layoutRoot.FindViewById(Resource.Id.personText);

            commitButton = (Button) layoutRoot.FindViewById(Resource.Id.manualCommit);
            commitButton.Click += (object sender, EventArgs e) => dataForm.CommitChanges();

            return layoutRoot;
        }
Esempio n. 3
0
 public void OnClick(View v)
 {
     dataForm.CommitChanges();
 }