Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.AddNote);

            // Create your application here

            _btnsave    = FindViewById <Button>(Resource.Id.btnSave);
            _btncancel  = FindViewById <Button>(Resource.Id.btnCancel);
            _txtTitle   = FindViewById <EditText>(Resource.Id.txtTitle);
            _txtDetails = FindViewById <EditText>(Resource.Id.txtNotes);

            //Generating Events
            _btnsave.Click   += _btnsave_Click;
            _btncancel.Click += _btncancel_Click;

            obj = new DataBaseManager();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            this.RequestWindowFeature(WindowFeatures.NoTitle);//Removing the title
            SetContentView(Resource.Layout.Main);


            // Get our button from the layout resource,

            lstToDoList = FindViewById <ListView>(Resource.Id.listView1);

            _txtcountNotes = FindViewById <TextView>(Resource.Id.txtNotesCount);

            _btnAdd     = FindViewById <ImageButton>(Resource.Id.btnAdd);
            _searchView = FindViewById <SearchView>(Resource.Id.searchView1);



            CopyDatabase();

            objDb  = new DataBaseManager();
            mylist = objDb.ViewAll();
            lstToDoList.Adapter = new DataAdapter(this, mylist);

            _txtcountNotes.Text = "Notes(" + mylist.Count + ")";

            // and attach an event to it

            lstToDoList.ItemClick += LstToDoList_ItemClick;
            _btnAdd.Click         += _btnAdd_Click;


            _searchView.QueryTextChange += _searchView_QueryTextChange;
        }