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

            Spinner validationModeSpinner = (Spinner) rootLayout.FindViewById(Resource.Id.data_form_validation_mode_spinner);
            validationModeSpinner.OnItemSelectedListener = this;
            validationModeSpinner.Adapter = new ArrayAdapter(this.Activity, Android.Resource.Layout.SimpleSpinnerItem, new ValidationMode[]{ValidationMode.Immediate, ValidationMode.OnLostFocus, ValidationMode.Manual});

            dataForm = new RadDataForm(this.Activity);

            dataForm.LayoutManager = new DataFormLinearLayoutManager(this.Activity);
            dataForm.CommitMode = CommitMode.Manual;
            dataForm.ValidationMode = ValidationMode.Immediate;

            Person joe = new Person();
            joe.Name = "Joe";
            joe.Mail = "*****@*****.**";
            dataForm.SetEntity (joe);

            validateButton = (Button)rootLayout.FindViewById(Resource.Id.data_form_validate_button);
            validateButton.SetOnClickListener(this);

            rootLayout.AddView(dataForm, 0);

            return rootLayout;
        }
        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 = Android.Runtime.Extensions.JavaCast<RadDataForm>(layoutRoot.FindViewById(Resource.Id.dataForm));

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

            dataForm.SetEntity (person);

            RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
            validator.Max = 30;
            validator.Min = 18;

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

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

            commitButton = (Button) layoutRoot.FindViewById(Resource.Id.manualCommit);
            commitButton.SetOnClickListener(this);

            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;
        }
		void AddPersonListListbox_Click(object sender, RoutedEventArgs e)
		{
			Person newPerson = new Person();
			newPerson.FirstName = "Karin";
			newPerson.LastName = "Huber";
			personList.Add(newPerson);
		}
		void AddPersonObservableListListbox_Click(object sender, RoutedEventArgs e)
		{
			Person newPerson = new Person();
			newPerson.FirstName = "Rainer";
			newPerson.LastName = "Stropek";
			personObservableList.Add(newPerson);
		}
        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 = Android.Runtime.Extensions.JavaCast<RadDataForm>(layoutRoot.FindViewById(Resource.Id.dataForm));
            dataForm.LayoutManager = new DataFormLinearLayoutManager (this.Activity);

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

            dataForm.Entity = new XamarinEntity(person);

            DataFormSpinnerEditor editor = Android.Runtime.Extensions.JavaCast<DataFormSpinnerEditor> (dataForm.GetExistingEditorForProperty("EmployeeType"));
            editor.Adapter = new Com.Telerik.Widget.Dataform.Visualization.Editors.Adapters.EditorSpinnerAdapter (this.Activity, new Java.Lang.Object[] { "PROGRAMMER", "MANAGER", "SUPPORT", "MARKETING" });

            RangeValidator validator = (RangeValidator) dataForm.GetExistingEditorForProperty("Age").Property().Validator;
            validator.Max = 30;
            validator.Min = 18;

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

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

            commitButton = (Button) layoutRoot.FindViewById(Resource.Id.manualCommit);
            commitButton.SetOnClickListener(this);

            return layoutRoot;
        }
Esempio n. 7
0
        public void Sample()
        {
            var person = new Person("bob", "jones");

            var fullname = person.LastName + ", " + person.FirstName;

            Expect(fullname, Is.EqualTo("jones, bob"));
        }
Esempio n. 8
0
		public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
		{
			ObservableCollection<Person> persons = new ObservableCollection<Person>();
			string personList = (string)value;
			string[] personArray = personList.Split(',');
			for (int i = 0; i < personArray.Length; i++)
			{
				Person p = new Person();
				string[] person = personArray[i].Trim().Split(' ');
				p.FirstName = person[0];
				p.LastName = person[1];
				persons.Add(p);
			}
			return persons;
		}
		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			ViewGroup rootLayout = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_grouping, null);

			RadDataForm dataForm = new RadDataForm(this.Activity);
			dataForm.LayoutManager = new DataFormLinearLayoutManager(this.Activity);
			Person person = new Person();
			person.Name = "Joe";
			dataForm.SetEntity(person);

			EntityPropertyEditor nameEditor = Android.Runtime.Extensions.JavaCast<EntityPropertyEditor>(dataForm.GetExistingEditorForProperty("Name"));
			nameEditor.Property().Validator = new NonEmptyValidator();
			nameEditor.ValidationViewBehavior = new ValidationAnimationBehavior(this.Activity);

			EntityPropertyEditor mailEditor = Android.Runtime.Extensions.JavaCast<EntityPropertyEditor>(dataForm.GetExistingEditorForProperty("Mail"));
			mailEditor.ValidationViewBehavior = new BlinkValidationBehavior(this.Activity);

			rootLayout.AddView(dataForm);

			return rootLayout;
		}
		public DataBindingNotification()
		{
			InitializeComponent();

			Person newPerson = new Person();
			newPerson.FirstName = "Rainer";
			newPerson.LastName = "Stropek";
			personList.Add(newPerson);

			newPerson = new Person();
			newPerson.FirstName = "Karin";
			newPerson.LastName = "Huber";
			personObservableList.Add(newPerson);

			ListListbox.ItemsSource = personList;
			ObservableListListbox.ItemsSource = personObservableList;

			AddPersonListListbox.Click += new RoutedEventHandler(AddPersonListListbox_Click);
			AddPersonObservableListListbox.Click += new RoutedEventHandler(AddPersonObservableListListbox_Click);

			ChangePerson.Click += new RoutedEventHandler(ChangePerson_Click);
			ChangeNotifyingPerson.Click += new RoutedEventHandler(ChangeNotifyingPerson_Click);
		}