mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-09 17:36:34 +08:00
添加Avalonia项目的demo
This commit is contained in:
36
Serein.Workbench.Avalonia/Views/MainWindow.axaml.cs
Normal file
36
Serein.Workbench.Avalonia/Views/MainWindow.axaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Newtonsoft.Json;
|
||||
using Serein.NodeFlow.Env;
|
||||
using System.Threading.Tasks;
|
||||
using Serein.Library;
|
||||
using Serein.Workbench.Avalonia.Services;
|
||||
|
||||
namespace Serein.Workbench.Avalonia.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
IKeyEventService keyEventService = App.GetService<IKeyEventService>();
|
||||
this.Loaded += MainWindow_Loaded;
|
||||
this.KeyDown += (o, e) =>
|
||||
{
|
||||
keyEventService.SetKeyState(e.Key, true);
|
||||
};
|
||||
this.KeyUp += (o, e) =>
|
||||
{
|
||||
keyEventService.SetKeyState(e.Key, false);
|
||||
};
|
||||
}
|
||||
|
||||
private void MainWindow_Loaded(object? sender, global::Avalonia.Interactivity.RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user