Ejemplo n.º 1
0
        private async void Button_OnClicked(object sender, EventArgs e)
        {
            try
            {
                if (_titel.Replace(" ", "").Length == 0)
                {
                    await DisplayAlert("Missing Title", "Please enter a title", "Ok");
                }
                else
                {
                    var quickie = new EasyListViewModel();

                    var list = new ObservableCollection <ListItemViewModel>()
                    {
                        new ListItemViewModel()
                        {
                            Item = "Hat"
                        },
                        new ListItemViewModel()
                        {
                            Item = "Gloves"
                        }
                    };

                    quickie.Items        = list;
                    quickie.Title        = _titel;
                    quickie.QuantityText = $"{quickie.GetPackedItems()} / {quickie.GetTotalItems()}";

                    _quickies.Add(quickie);

                    //if (Application.Current is App app) app.MainList = _quickies;

                    await Navigation.PopToRootAsync();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                await DisplayAlert("Error", "Something went wrong", "Ok");
            }
        }
Ejemplo n.º 2
0
 private void UpdateTitle()
 {
     TitleLabel.Text            = $"{_selectedList.GetPackedItems()} / {_selectedList.GetTotalItems()}";
     _selectedList.QuantityText = TitleLabel.Text;
     _selectedList.EasyPacked   = _selectedList.GetPackedItems() == _selectedList.GetTotalItems();
 }