Свойство AddExercisionCommand не найдено в проектеAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Свойство AddExercisionCommand не найдено в проекте

Сообщение Anonymous »


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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»