FinalPresenceLexa/Presence/StudentsWindow.axaml.cs

28 lines
656 B
C#
Raw Normal View History

2025-04-28 08:51:01 +00:00
using Avalonia.Controls;
using System.Linq;
using data;
using data.RemoteData.RemoteDataBase;
namespace Presence
{
public partial class StudentsWindow : Window
{
private readonly RemoteDatabaseContext _context;
public StudentsWindow()
{
InitializeComponent();
_context = new RemoteDatabaseContext();
LoadStudents();
BtnRefreshStudents.Click += (s, e) => LoadStudents();
}
private void LoadStudents()
{
var users = _context.Users.ToList();
StudentsList.ItemsSource = users.Select(s => $"{s.FIO}").ToList();
}
}
}