This commit is contained in:
1 parent
c79d96c5ec
commit
d4b1419f9a
7 files changed
+951
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels.Groups;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Groups;
|
||||
|
||||
public partial class StudentGroupGeneratorWindow : Window
|
||||
{
|
||||
private bool _isAnimating;
|
||||
|
||||
public StudentGroupGeneratorWindow() => InitializeComponent();
|
||||
|
||||
private async void OnGenerate(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_isAnimating || DataContext is not StudentGroupGeneratorViewModel vm ||
|
||||
!vm.GenerateCommand.CanExecute(null)) return;
|
||||
_isAnimating = true;
|
||||
var results = this.FindControl<Grid>("GroupResults");
|
||||
if (results is not null) results.Opacity = 0.15;
|
||||
await Task.Delay(140);
|
||||
vm.GenerateCommand.Execute(null);
|
||||
if (results is not null) results.Opacity = 1;
|
||||
_isAnimating = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user