예제 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            contactsListView         = FindViewById <ListView>(Resource.Id.ContactsListView);
            myContactsAdapter        = new MyContactsAdapter(this, myContacts);
            contactsListView.Adapter = myContactsAdapter;

            Button button = FindViewById <Button>(Resource.Id.cmdGetContacts);

            button.Click += delegate {
                // add event handler code for button
                myContacts.Clear();
                myContacts.Add(new MyContact {
                    Name = "Mike Fitzmaurice", Email = "*****@*****.**"
                });
                myContacts.Add(new MyContact {
                    Name = "Chris Sells", Email = "*****@*****.**"
                });
                myContacts.Add(new MyContact {
                    Name = "Brian Cox", Email = "*****@*****.**"
                });

                myContactsAdapter.AddAll(myContacts);
                myContactsAdapter.NotifyDataSetChanged();
            };
        }
예제 #2
0
    protected override void OnCreate(Bundle bundle) {
      base.OnCreate(bundle);

      SetContentView(Resource.Layout.Main);

      contactsListView = FindViewById<ListView>(Resource.Id.ContactsListView);
      myContactsAdapter = new MyContactsAdapter(this, myContacts);
      contactsListView.Adapter = myContactsAdapter;

      Button button = FindViewById<Button>(Resource.Id.cmdGetContacts);
      button.Click += async delegate {
        // add event handler code for button
        await Office365Service.EnsureClientCreated(this);
        myContacts = await Office365Service.GetMyContacts();
        myContactsAdapter.AddAll(myContacts);
        myContactsAdapter.NotifyDataSetChanged();
      };
    }
    protected override void OnCreate(Bundle bundle) {
      base.OnCreate(bundle);

      SetContentView(Resource.Layout.Main);

      contactsListView = FindViewById<ListView>(Resource.Id.ContactsListView);
      myContactsAdapter = new MyContactsAdapter(this, myContacts);
      contactsListView.Adapter = myContactsAdapter;

      Button button = FindViewById<Button>(Resource.Id.cmdGetContacts);
      button.Click += delegate {
        // add event handler code for button
        myContacts.Clear();
        myContacts.Add(new MyContact { Name = "Mike Fitzmaurice", Email = "*****@*****.**" });
        myContacts.Add(new MyContact { Name = "Chris Sells", Email = "*****@*****.**" });
        myContacts.Add(new MyContact { Name = "Brian Cox", Email = "*****@*****.**" });

        myContactsAdapter.AddAll(myContacts);
        myContactsAdapter.NotifyDataSetChanged();
      };
    }
예제 #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            contactsListView         = FindViewById <ListView>(Resource.Id.ContactsListView);
            myContactsAdapter        = new MyContactsAdapter(this, myContacts);
            contactsListView.Adapter = myContactsAdapter;

            Button button = FindViewById <Button>(Resource.Id.cmdGetContacts);

            button.Click += async delegate {
                // add event handler code for button
                await Office365Service.EnsureClientCreated(this);

                myContacts = await Office365Service.GetMyContacts();

                myContactsAdapter.AddAll(myContacts);
                myContactsAdapter.NotifyDataSetChanged();
            };
        }