|
@@ -2,6 +2,7 @@ using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
|
+using Avalonia.Threading;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using EntranseTesting.Models;
|
|
using EntranseTesting.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
@@ -18,7 +19,7 @@ namespace EntranseTesting.ViewModels
|
|
[ObservableProperty]DateTime startDate = DateTime.Today;
|
|
[ObservableProperty]DateTime startDate = DateTime.Today;
|
|
DateTime selectedEndDate = DateTime.Today;
|
|
DateTime selectedEndDate = DateTime.Today;
|
|
DateTime selectedStartDate = DateTime.Today;
|
|
DateTime selectedStartDate = DateTime.Today;
|
|
-
|
|
|
|
|
|
+ [ObservableProperty] DispatcherTimer timer = new DispatcherTimer();
|
|
|
|
|
|
public ResultMainViewModel()
|
|
public ResultMainViewModel()
|
|
{
|
|
{
|
|
@@ -26,6 +27,14 @@ namespace EntranseTesting.ViewModels
|
|
StartDate = connection.UserSessions.OrderBy(tb => tb.Date).ToList().First().Date;
|
|
StartDate = connection.UserSessions.OrderBy(tb => tb.Date).ToList().First().Date;
|
|
SelectedStartDate = StartDate;
|
|
SelectedStartDate = StartDate;
|
|
filter();
|
|
filter();
|
|
|
|
+ timer.Interval = new TimeSpan(0, 1, 30);
|
|
|
|
+ timer.Tick += restart;
|
|
|
|
+ timer.Start();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void restart(object? sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ filter();
|
|
}
|
|
}
|
|
|
|
|
|
public ObservableCollection<UserSession> Answers { get => answers; set => answers = value; }
|
|
public ObservableCollection<UserSession> Answers { get => answers; set => answers = value; }
|