I want to make a fitness app which keeps your workouts. Im trying to make a list in which you can add your exercises and sets reps and weight but it didnt work. I tried to make a counter (sets) which increments every time the button is pressed but didnt manage to. View
<!-- Display ExerciseTypeGroups -->
<ListView ItemsSource="{Binding ExerciseTypeGroups}" HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<!-- Display ExerciseType of the group -->
<StackLayout Margin="0,0,0,0">
<Label Text="{Binding ExerciseType.Name}" FontSize="25" Padding="10" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Entry for Reps -->
<Entry Grid.Column="0" Placeholder="Reps" Keyboard="Numeric" Text="{Binding NewExerciseReps}" />
<!-- Entry for Volume -->
<Entry Grid.Column="1" Placeholder="Volume" Keyboard="Numeric" Text="{Binding NewExerciseVolume}" />
<!-- Button to add exercise to the group -->
<Button Grid.Column="2" Text="Complete" Command="{Binding CompleteExerciseCommand}" />
</Grid>
<Button Grid.Column="1" Text="Add Exercise" Command="{Binding AddExerciseToGroupCommand}" VerticalOptions="End"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
ViewModel
public ICommand AddExerciseToGroupCommand => new Command(AddExerciseToGroup);
private void AddExerciseToGroup()
{
OnPropertyChanged(nameof(ExerciseTypeGroups));
}