2025-01-28 12:20:48 +00:00
|
|
|
using System;
|
2025-01-22 13:34:31 +00:00
|
|
|
using System.Collections.Generic;
|
2025-01-28 12:20:48 +00:00
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
2025-01-22 13:34:31 +00:00
|
|
|
using Avalonia.Controls;
|
|
|
|
using Avalonia.Interactivity;
|
2025-01-28 12:20:48 +00:00
|
|
|
using Avalonia.Media.Imaging;
|
|
|
|
using Avalonia.Platform.Storage;
|
|
|
|
using Avalonia.Win32;
|
2025-01-22 13:34:31 +00:00
|
|
|
using demo_2023.Models;
|
|
|
|
|
|
|
|
namespace demo_2023;
|
|
|
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
{
|
2025-01-28 12:20:48 +00:00
|
|
|
ObservableCollection<Event> events = new ObservableCollection<Event>();
|
|
|
|
List<Event> dataSourseEvent;
|
|
|
|
|
2025-01-22 13:34:31 +00:00
|
|
|
public MainWindow()
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
2025-01-28 12:20:48 +00:00
|
|
|
using var context = new User15Context();
|
|
|
|
|
|
|
|
dataSourseEvent = context.Events.ToList();
|
|
|
|
EventListBox.ItemsSource = dataSourseEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class EventPresenter() : Event
|
|
|
|
{
|
|
|
|
Bitmap? image
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
string absolutePath = Path.Combine(AppContext.BaseDirectory, photo);
|
|
|
|
return new Bitmap(absolutePath);
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2025-01-22 13:34:31 +00:00
|
|
|
}
|
|
|
|
|
2025-01-28 12:20:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Jury_reg(object? sender, RoutedEventArgs e)
|
2025-01-22 13:34:31 +00:00
|
|
|
{
|
|
|
|
new Additem().ShowDialog(this);
|
|
|
|
}
|
|
|
|
|
2025-01-28 12:20:48 +00:00
|
|
|
}
|