예제 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup   layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_data_form_schema_setup, container, false);
            RadDataForm dataForm   = (RadDataForm)layoutRoot.FindViewById(Resource.Id.data_form_schema);

            String json = LoadJSONFromAsset("PersonExtended.json");

            try {
                JSONObject jsonObject = new JSONObject(json);
                dataForm.SetEntity(jsonObject);

                String           schema     = LoadJSONFromAsset("PersonSchema.json");
                JSONObject       jsonSchema = new JSONObject(schema);
                DataFormMetadata metadata   = new DataFormMetadata(jsonSchema);
                dataForm.Metadata = metadata;
            } catch (JSONException e) {
                Log.Error("json", "error parsing json", e);
            }

            return(layoutRoot);
        }
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			ViewGroup layoutRoot = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_data_form_schema_setup, container, false);
			RadDataForm dataForm = new RadDataForm(Activity);

			String json = LoadJSONFromAsset ("PersonExtended.json");
			try {
				JSONObject jsonObject = new JSONObject (json);
				dataForm.SetEntity(jsonObject);

				String schema = LoadJSONFromAsset("PersonSchema.json");
				JSONObject jsonSchema = new JSONObject(schema);
				DataFormMetadata metadata = new DataFormMetadata(jsonSchema);
				dataForm.SetMetadata(metadata);
			} catch(JSONException e) {
				Log.Error ("json", "error parsing json", e);
			}

			layoutRoot.AddView(dataForm);

			return layoutRoot;
		}