Merge pull request #43 from irihitech/hotkey
Add new Control: KeyGestureInput
This commit is contained in:
20
demo/Ursa.Demo/Pages/KeyGestureInputDemo.axaml
Normal file
20
demo/Ursa.Demo/Pages/KeyGestureInputDemo.axaml
Normal file
@@ -0,0 +1,20 @@
|
||||
<UserControl
|
||||
x:Class="Ursa.Demo.Pages.KeyGestureInputDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:KeyGestureInputDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel Margin="20">
|
||||
<TextBlock Text="Accept all keys" />
|
||||
<u:KeyGestureInput HorizontalAlignment="Left" Width="500" />
|
||||
<TextBlock Text="Accept only A,B and C" />
|
||||
<u:KeyGestureInput HorizontalAlignment="Left" AcceptableKeys="{Binding AcceptableKeys}" Width="500" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
18
demo/Ursa.Demo/Pages/KeyGestureInputDemo.axaml.cs
Normal file
18
demo/Ursa.Demo/Pages/KeyGestureInputDemo.axaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Ursa.Demo.Pages;
|
||||
|
||||
public partial class KeyGestureInputDemo : UserControl
|
||||
{
|
||||
public KeyGestureInputDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user