about summary refs log tree commit diff
path: root/ModerationClient/Views/MainWindow/LoginView.axaml.cs
blob: 5e84ace7e60dcfaff89553da6a741006598b8daf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using ModerationClient.ViewModels;

namespace ModerationClient.Views;

public partial class LoginView : UserControl {
    public LoginView() {
        InitializeComponent();
    }

    // ReSharper disable once AsyncVoidMethod
    private async void Login(object? _, RoutedEventArgs __) {
        await (DataContext as LoginViewModel ?? throw new InvalidCastException("LoginView did not receive LoginViewModel?")).LoginAsync();
    }
}