Exemplo n.º 1
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Azure Mobile Service を使う
            client = new MobileServiceClient(applicationURL);
            // ToDo テーブルを更新対象にする
            todoTable = client.GetTable <ToDo>();
            items     = new List <ToDo>();

            listview            = FindViewById <ListView>(Resource.Id.listView);
            listview.Adapter    = adapter = new TodoAdapter(this, items);
            listview.ItemClick += Listview_ItemClick;

            btnNew     = FindViewById <Button>(Resource.Id.buttonNew);
            btnSetting = FindViewById <Button>(Resource.Id.buttonSetting);

            btnNew.Click     += BtnNew_Click;
            btnSetting.Click += BtnSetting_Click;

            await RefreshItemsFromTableAsync();
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // 内部ストレージから読み込み
            items = new ToDoFiltableCollection();
            this.Load();
            listview            = FindViewById <ListView>(Resource.Id.listView);
            listview.Adapter    = adapter = new TodoAdapter(this, items);
            listview.ItemClick += Listview_ItemClick;

            btnNew     = FindViewById <Button>(Resource.Id.buttonNew);
            btnSetting = FindViewById <Button>(Resource.Id.buttonSetting);

            btnNew.Click     += BtnNew_Click;
            btnSetting.Click += BtnSetting_Click;
        }