예제 #1
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Watch for the selection value changing
            PeopleArray.AddObserver("selectionIndexes", NSKeyValueObservingOptions.New, (sender) => {
                // Inform caller of selection change
                RaisePersonSelected((nint)PeopleArray.SelectionIndex);
            });
        }
예제 #2
0
        void ReleaseDesignerOutlets()
        {
            if (PeopleCollection != null)
            {
                PeopleCollection.Dispose();
                PeopleCollection = null;
            }

            if (PeopleArray != null)
            {
                PeopleArray.Dispose();
                PeopleArray = null;
            }
        }
예제 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Build list of employees
            AddPerson(new PersonModel("Craig Dunn", "Documentation Manager", true));
            AddPerson(new PersonModel("Amy Burns", "Technical Writer"));
            AddPerson(new PersonModel("Joel Martinez", "Web & Infrastructure"));
            AddPerson(new PersonModel("Kevin Mullins", "Technical Writer"));
            AddPerson(new PersonModel("Mark McLemore", "Technical Writer"));
            AddPerson(new PersonModel("Tom Opgenorth", "Technical Writer"));
            AddPerson(new PersonModel("Larry O'Brien", "API Documentation Manager", true));
            AddPerson(new PersonModel("Mike Norman", "API Documentor"));

            // Watch for the selection value changing
            PeopleArray.AddObserver("selectionIndexes", NSKeyValueObservingOptions.New, (sender) => {
                // Inform caller of selection change
                try {
                    SelectedPerson = _people.GetItem <PersonModel>((nuint)SelectionIndex);
                } catch {
                    SelectedPerson = null;
                }
            });
        }