Свойство AddExercisionCommand не найдено в проекте ⇐ Android
-
Anonymous
Свойство AddExercisionCommand не найдено в проекте
Im trying to use a command in the view and the output says 'AddExerciseCommand' property not found on 'Muscles_app.Models.ExerciseTypeGroup', target property: 'Xamarin.Forms.Button.Command' How do I fix it? Why is it not found. I have a working command in the class so it cant be missing some connection between the view and the viewmodel
public ICommand AddExerciseCommand => new Command(AddExercise); private void AddExercise() { if (SelectedGroup == null) { // Handle the case where no group is selected return; } // Example: Adding a new exercise to the selected ExerciseTypeGroup var newExercise = new Exercise { Reps = 0, // Set default values or initialize as needed Weight = 0 }; // Add the new exercise to the group SelectedGroup.ExercisesInGroup.Add(newExercise); // Dynamically add a new row to the grid AddGridRow(); // You may want to update other properties or trigger events as needed OnPropertyChanged(nameof(ExerciseTypeGroups)); }
Источник: https://stackoverflow.com/questions/780 ... on-project
Im trying to use a command in the view and the output says 'AddExerciseCommand' property not found on 'Muscles_app.Models.ExerciseTypeGroup', target property: 'Xamarin.Forms.Button.Command' How do I fix it? Why is it not found. I have a working command in the class so it cant be missing some connection between the view and the viewmodel
public ICommand AddExerciseCommand => new Command(AddExercise); private void AddExercise() { if (SelectedGroup == null) { // Handle the case where no group is selected return; } // Example: Adding a new exercise to the selected ExerciseTypeGroup var newExercise = new Exercise { Reps = 0, // Set default values or initialize as needed Weight = 0 }; // Add the new exercise to the group SelectedGroup.ExercisesInGroup.Add(newExercise); // Dynamically add a new row to the grid AddGridRow(); // You may want to update other properties or trigger events as needed OnPropertyChanged(nameof(ExerciseTypeGroups)); }
Источник: https://stackoverflow.com/questions/780 ... on-project
Мобильная версия