Пример #1
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            showNotificationButton        = (Button)view.FindViewById(Resource.Id.show_notification_button);
            showNotificationButton.Click += delegate {
                Priority selectedPriority = Priority.FromString(prioritySpinner.SelectedItem.ToString());
                Category selectedCategory = Category.FromString(categorySpinner.SelectedItem.ToString());
                ShowNotificationClicked(selectedPriority, selectedCategory, contactUri);
            };
            categorySpinner = (Spinner)view.FindViewById(Resource.Id.category_spinner);
            ArrayAdapter <Category> categoryArrayAdapter = new ArrayAdapter <Category> (Activity, Android.Resource.Layout.SimpleSpinnerItem, Category.Values);

            categoryArrayAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            categorySpinner.Adapter = categoryArrayAdapter;

            prioritySpinner = (Spinner)view.FindViewById(Resource.Id.priority_spinner);
            ArrayAdapter <Priority> priorityArrayAdapter = new ArrayAdapter <Priority> (Activity, Android.Resource.Layout.SimpleSpinnerItem, Priority.Values);

            priorityArrayAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            prioritySpinner.Adapter = priorityArrayAdapter;

            view.FindViewById(Resource.Id.attach_person).Click += delegate {
                FindContact();
            };
            view.FindViewById(Resource.Id.contact_entry).Visibility = ViewStates.Gone;
        }