private void InsertWithHeader(int index, ITaskViewModel newTask) { MainLayout.Children.Insert(index, new TaskView(newTask)); MainLayout.Children.Insert(index, new Label { Text = DateToTextConverter.Convert(newTask.ScheduleDate), FontSize = 13, TextColor = ((App)App.Current).ColorPrimary }); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var text = Resources.StartDate; var date = value as DateTime?; if (date == null) { return($"{text} {Resources.IsNotSet}"); } return($"{text}: {DateToTextConverter.Convert(date)}"); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var habit = value as HabitViewModel; var date = habit?.StartDate; if (date == null) { return(string.Empty); } var startDate = DateToTextConverter.Convert(date); var repeatText = GetRepeatText(habit.RepeatType, habit.DaysToRepeat); var dayAmountText = habit.HabitType == HabitType.Daylong ? $"{Resources.AllDay.ToLower()}" : $"{habit.RepeatsToday} {Resources.TimesADay.ToLower()}"; return($"From {startDate} - {repeatText} {dayAmountText}"); }