Beispiel #1
0
        private async void TryAddIndividual(object sender, EventArgs e)
        {
            var vm = ((RegisterViewModel)BindingContext);

            if (string.IsNullOrEmpty(vm.NewIndividualName) || vm.NewIndividualName.All(c => char.IsWhiteSpace(c)))
            {
                await Task.Delay(100);

                IndividualNameEntry.Shake();
                IndividualNameEntry.Focus();
            }
            else
            {
                vm.AddIndividualCommand.Execute(null);
            }
        }
Beispiel #2
0
        private void TryAddIndividualsGroup(object sender, EventArgs e)
        {
            var vm = ((RegisterViewModel)BindingContext);

            if (string.IsNullOrEmpty(vm.NewGroupName) || vm.NewGroupName.All(c => char.IsWhiteSpace(c)))
            {
                NewGroupNameEntry.Shake();
                NewGroupNameEntry.Focus();
                return;
            }

            if (vm.Individuals.Count == 0)
            {
                IndividualsCountLabel.Shake();
                if (!string.IsNullOrEmpty(vm.NewGroupName))
                {
                    IndividualNameEntry.Focus();
                    return;
                }
            }
            vm.AddIndividualsGroupCommand.Execute(null);
        }