Add intelligent random student picker
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
admin committed 2026-09-29 14:02:48 +02:00
1 parent 770a1833c8
commit c79d96c5ec
7 files changed
+426

No files matched your search

@@ -0,0 +1,26 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using LehrerApp.Desktop.ViewModels.Groups;
namespace LehrerApp.Desktop.Views.Groups;
public partial class RandomStudentPickerWindow : Window
{
private bool _isAnimating;
public RandomStudentPickerWindow() => InitializeComponent();
private async void OnDraw(object? sender, RoutedEventArgs e)
{
if (_isAnimating || DataContext is not RandomStudentPickerViewModel vm ||
!vm.DrawCommand.CanExecute(null)) return;
_isAnimating = true;
var card = this.FindControl<Border>("RevealCard");
if (card is not null) card.Opacity = 0.15;
await Task.Delay(150);
vm.DrawCommand.Execute(null);
if (card is not null) card.Opacity = 1;
_isAnimating = false;
}
}