Skip to content

Commit

Permalink
[PR] [ilyalehchylinGH-79] Fixed current calendar position
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalehchylin authored Apr 14, 2020
2 parents 1609800 + 318387e commit ff7de9c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EduCATS.Data;
using EduCATS.Data.Models;
Expand Down Expand Up @@ -129,7 +130,6 @@ void initSetup()
{
try {
_manualSelectedCalendarDay = new DateTime();
_services.Device.MainThread(() => CalendarPosition = 1);
CalendarSubjects = new List<CalendarSubjectsModel>();
CalendarDaysOfWeekList = new ObservableCollection<string>(DateHelper.GetDaysWithFirstLetters());
setInitialCalendarState();
Expand All @@ -155,6 +155,16 @@ void setInitialCalendarState()
};

selectCalendarDay(todayDateTime);
setInitialCalendarPosition();
}

// FIXME: Workaround for initial calendar position setup.
void setInitialCalendarPosition()
{
Task.Run(() => {
Thread.Sleep(1000);
_services.Device.MainThread(() => CalendarPosition = 1);
});
}

void update()
Expand Down

0 comments on commit ff7de9c

Please sign in to comment.