Ejemplo n.º 1
0
        public RigidBody(PhysicsController physics)
        {
            Physics = physics;
            Id      = Guid.NewGuid();

            Physics.GetSolver().onAdd += point =>
            {
                ContactAdd?.Invoke(point);
            };
        }
Ejemplo n.º 2
0
        async private void saveBtn_Clicked(object sender, EventArgs e)
        {
            var contact = BindingContext as Contact;

            if (string.IsNullOrEmpty(contact.FirstName) && string.IsNullOrEmpty(contact.LastName))
            {
                await DisplayAlert("Validation failed", "Please enter the name", "OK");
            }
            else
            {
                if (contact.Id == null)
                {
                    ContactAdd?.Invoke(this, contact);
                }
                else
                {
                    ContactUpdate?.Invoke(this, contact);
                }
                await Navigation.PopAsync();
            }
        }