public override void OnStart () { base.OnStart (); _edName = _activity.FindViewById<EditText>(Resource.Id.edGeneralName); _edVorname = _activity.FindViewById<EditText> (Resource.Id.edVorname); _edNummer = _activity.FindViewById<EditText> (Resource.Id.edNummer); _edStrasse = _activity.FindViewById<EditText> (Resource.Id.edStrasse); _edPLZ = _activity.FindViewById<EditText> (Resource.Id.edPLZ); _edOrt = _activity.FindViewById<EditText> (Resource.Id.edOrt); _spinnerLand = _activity.FindViewById<Spinner>(Resource.Id.spinnerAnsprechpartnerLand); _edTelefon = _activity.FindViewById<EditText>(Resource.Id.edTelefon); _edEmail = _activity.FindViewById<EditText> (Resource.Id.edEmail); _tvEmail = _activity.FindViewById<TextView> (Resource.Id.tvEmail); _tvNummer = _activity.FindViewById<TextView> (Resource.Id.tvNummer); _tvTelefon = _activity.FindViewById<TextView> (Resource.Id.tvTelefon); _tvUmsatz = _activity.FindViewById<TextView> (Resource.Id.tvUmsatz); CountryViewAdapter _adapterCountry = new CountryViewAdapter(_activity); // New Handler, not to forget to unsubscribe in the OnPause Event // important, because when another activity (like Setting) overpaints the MainActivity and hides again OnStart will be called again and then this events is called twice!! _spinnerLand.Touch += SpinnerLand_Touch; _spinnerLand.Adapter = _adapterCountry; _spinnerAnsprechpartner = _activity.FindViewById<Spinner> (Resource.Id.spinnerAnsprechpartner); _spinnerAnsprechpartner.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs> (_stateFragment.SpinnerItemSelected ); AnsprechpartnerViewAdapter _adapter = new AnsprechpartnerViewAdapter (_activity, _stateFragment._ansprechpartnern); _spinnerAnsprechpartner.Adapter = _adapter; // New Handler, not to forget to unsubscribe in the OnPause Event // important, because when another activity (like Setting) overpaints the MainActivity and hides again OnStart will be called again and then this events is called twice!! _spinnerAnsprechpartner.Touch += SpinnerAnsprechpartner_Touch; // Disable the controls if necessary _stateFragment.GetControlReferences(); if (_edVorname.Enabled == false) _stateFragment.DisableControls(); }
public override void OnStart () { base.OnStart (); _edName = _activity.FindViewById<EditText>(Resource.Id.edGeneralName); _edNummer = _activity.FindViewById<EditText> (Resource.Id.edNummer); _edStrasse = _activity.FindViewById<EditText> (Resource.Id.edStrasse); _edPLZ = _activity.FindViewById<EditText> (Resource.Id.edPLZ); _edOrt = _activity.FindViewById<EditText> (Resource.Id.edOrt); _edTelefon = _activity.FindViewById<EditText> (Resource.Id.edTelefon); _edEmail = _activity.FindViewById<EditText> (Resource.Id.edEmail); _tvEmail = _activity.FindViewById<TextView> (Resource.Id.tvEmail); _tvTelefon = _activity.FindViewById<TextView>(Resource.Id.tvTelefon); _edSperrdatum = _activity.FindViewById<EditText>(Resource.Id.edSperrdatum); _edSperrgrund = _activity.FindViewById<EditText>(Resource.Id.edSperrgrund); _btnClear = _activity.FindViewById<ImageButton>(Resource.Id.btnClearSperrDatum); _spinnerLand = _activity.FindViewById<Spinner> (Resource.Id.spinnerLand); CountryViewAdapter _adapterCountry = new CountryViewAdapter (_activity); // New Handler, not to forget to unsubscribe in the OnPause Event // important, because when another activity (like Setting) overpaints the MainActivity and hides again OnStart will be called again and then this events is called twice!! _spinnerLand.Touch += SpinnerLand_Touch; _spinnerLand.Adapter = _adapterCountry; _btnClear.Click += (object sender, EventArgs e) => { _edSperrdatum.Text = ""; }; // Check for object instance if (_stateFragment == null || _stateFragment._stateClass == null) return; if (_stateFragment._stateClass._person != null) { _edName.Text = _stateFragment._stateClass._person.ID; _edName.Text = _stateFragment._stateClass._person.GetID (); _edName.Text = _stateFragment._stateClass._person.Name; _edNummer.Text = _stateFragment._stateClass._person.Nummer; _edStrasse.Text = _stateFragment._stateClass._person.Strasse; _edPLZ.Text =_stateFragment._stateClass._person.PLZ; _edOrt.Text =_stateFragment._stateClass._person.Ort; _spinnerLand.SetSelection(((CountryViewAdapter)_spinnerLand.Adapter).GetItemIndex (_stateFragment._stateClass._person.LandNummer)); _edTelefon.Text =_stateFragment._stateClass._person.Telefon; _edEmail.Text = _stateFragment._stateClass._person.Email; _tvEmail.Text = _stateFragment._stateClass._person.Email; _tvTelefon.Text = _stateFragment._stateClass._person.Telefon; _edSperrdatum.Text = _stateFragment._stateClass._person.Sperrdatum; _edSperrgrund.Text = _stateFragment._stateClass._person.Sperrgrund; } // Disable the controls if necessary _stateFragment.GetControlReferences(); if (_edName.Enabled == false) _stateFragment.DisableControls(); }