private int repetitions;
private Landmark[,] poseLandmarks;
private bool isSummaryVisible;
+ private ICommand summaryBackCommand;
private ICommand summaryOkCommand;
private string summaryTitle;
private bool isLoading;
HoldTimeThreshold = 1200,
};
SquatService.ExerciseStateUpdated += SquatService_ExerciseStateUpdated;
- SummaryBackCommand = new Command(ExecuteCloseSummary);
}
/// <summary>
/// Gets a <see cref="ICommand"/> of SummaryView back button.
/// </summary>
- public ICommand SummaryBackCommand { get; private set; }
+ public ICommand SummaryBackCommand
+ {
+ get => summaryBackCommand;
+ private set
+ {
+ if (value != summaryBackCommand)
+ {
+ summaryBackCommand = value;
+ RaisePropertyChanged();
+ }
+ }
+ }
/// <summary>
/// Gets a <see cref="ICommand"/> of SummaryView ok button.
if (State == WorkoutState.Playing)
{
State = WorkoutState.Paused;
+ SummaryBackCommand = new Command(ExecuteCloseSummaryAndPlay);
+ }
+ else
+ {
+ SummaryBackCommand = new Command(ExecuteCloseSummary);
}
SummaryOkCommand = new Command(() => { ExecuteChangeWorkout(offset); });
IsSummaryVisible = true;
}
- private void ExecuteCloseSummary()
+ private void ExecuteCloseSummaryAndPlay()
{
State = WorkoutState.Playing;
+ ExecuteCloseSummary();
+ }
+
+ private void ExecuteCloseSummary()
+ {
IsSummaryVisible = false;
}
private void ConfirmTryAgain()
{
+ SummaryBackCommand = new Command(ExecuteCloseSummary);
SummaryOkCommand = new Command(() => { ExecuteChangeWorkout(); });
SummaryTitle = GetSummaryTitle(SummaryType.TryAgain);
IsSummaryVisible = true;
private void ConfirmEndWorkout()
{
+ SummaryBackCommand = new Command(ExecuteCloseSummary);
SummaryOkCommand = new Command(Services.NavigationService.Instance.PopToRoot);
SummaryTitle = GetSummaryTitle(SummaryType.EndWorkout);
IsSummaryVisible = true;