예제 #1
0
        public ListViewPage()
        {
            Items         = new ObservableCollection <string>(new [] { "Item #1" });
            DeleteCommand = new Command <string>(DeleteItem);
            ClearCommand  = new Command(ClearAll);
            InitializeComponent();

            BindingContext = this;

            CurrentItem.Completed += (sender, args) =>
            {
                if (string.IsNullOrEmpty(CurrentItem.Text))
                {
                    return;
                }
                Items.Add(CurrentItem.Text);
                CurrentItem.Text = string.Empty;

                CurrentItem.Focus();
            };
        }