public CustomTransportSelectionViewModel(INavigation navigation, SelectableObservableCollection <Model.TransportModeItem> activeItems)
        {
            _navigation  = navigation ?? throw new ArgumentNullException(nameof(navigation));
            _activeItems = activeItems ?? throw new ArgumentNullException(nameof(activeItems));

            SaveCommand = new Command(async() =>
            {
                if (Text.Contains(","))
                {
                    await Acr.UserDialogs.UserDialogs.Instance.AlertAsync(AppResources.CommaRestrictionText, AppResources.CommaRestrictionTitle, AppResources.OkText);
                }
                else
                {
                    activeItems.Add(new Model.TransportModeItem()
                    {
                        Id = Text, Name = Text
                    }, true);
                    await _navigation.PopModalAsync();
                }
            });

            CancelCommand = new Command(async() =>
            {
                await _navigation.PopModalAsync();
            });
        }
예제 #2
0
        private void RetrieveDeliveryOrders()
        {
            Orders = new SelectableObservableCollection <DeliveryOrder>();

            string[] mockPickTickets = { "123456", "654321", "098765", "109283", "657483", "109283", "384756", "209384", "5682038", "797451" };

            foreach (var pickTicket in mockPickTickets)
            {
                Orders.Add(new DeliveryOrder {
                    PickTicketNumber = pickTicket
                });
            }
        }
예제 #3
0
        public static async void bindAttendanceData()
        {
            var studentData = await App.Database.GetAttendanceAsync();

            studentlist.Clear();
            if (studentData.Count > 0)
            {
                foreach (var element in studentData)
                {
                    studentlist.Add(element);
                }
            }
        }