This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user