diff --git a/GSS2/App.axaml.cs b/GSS2/App.axaml.cs index fa1c6b8..b722263 100644 --- a/GSS2/App.axaml.cs +++ b/GSS2/App.axaml.cs @@ -23,6 +23,8 @@ public partial class Application : Avalonia.Application private bool _allShutdownSequencesRunning; + public NavigationService Navigation { get; } + public Application(IServiceProvider services, bool fullscreen = false) { _services = services; @@ -35,6 +37,7 @@ public partial class Application : Avalonia.Application // Создаём DependencyInjectionViewLocator _logger = _services.GetRequiredService>(); _viewLocator = _services.GetRequiredService(); + Navigation = _services.GetRequiredService(); } public override void Initialize() @@ -95,9 +98,6 @@ public partial class Application : Avalonia.Application Environment.Exit(1); } - // Создаём сервис навигации между элементами управления - var navigationService = _services.GetRequiredService(); - // Создаём начальный элемент управления и переходим к нему var mainView = new MainView() { @@ -131,7 +131,7 @@ public partial class Application : Avalonia.Application desktop.MainWindow = mainWindow; // Переключаемся на начальный элемент управления - navigationService.NavigateTo(mainView); + Navigation.NavigateTo(mainView); break; diff --git a/GSS2/TouchNumericUpDown.cs b/GSS2/TouchNumericUpDown.cs new file mode 100644 index 0000000..4c08847 --- /dev/null +++ b/GSS2/TouchNumericUpDown.cs @@ -0,0 +1,22 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Input; + +namespace GSS2; + +public class TouchNumericUpDown : NumericUpDown +{ + protected override Type StyleKeyOverride => typeof(NumericUpDown); + + public TouchNumericUpDown() + : base() + { + AddHandler(PointerPressedEvent, OnPointerPressed, handledEventsToo: true); + } + + private void OnPointerPressed(object? sender, PointerPressedEventArgs ea) + { + Console.WriteLine($"TODO: process TouchNumericUpDown.PointerPressed event"); + + } +} diff --git a/GSS2/TouchTextBox.cs b/GSS2/TouchTextBox.cs new file mode 100644 index 0000000..65799db --- /dev/null +++ b/GSS2/TouchTextBox.cs @@ -0,0 +1,20 @@ +using Avalonia.Controls; +using Avalonia.Input; + +namespace GSS2; + +public class TouchTextBox : TextBox +{ + protected override Type StyleKeyOverride => typeof(TextBox); + + public TouchTextBox() + : base() + { + AddHandler(PointerPressedEvent, OnPointerPressed, handledEventsToo: true); + } + + private void OnPointerPressed(object? sender, PointerPressedEventArgs ea) + { + Console.WriteLine($"TODO: process TouchTextBox.PointerPressed event"); + } +} diff --git a/GSS2/Views/AmineContent/SampleCalibrationView.axaml b/GSS2/Views/AmineContent/SampleCalibrationView.axaml index 41ace78..16a39f4 100644 --- a/GSS2/Views/AmineContent/SampleCalibrationView.axaml +++ b/GSS2/Views/AmineContent/SampleCalibrationView.axaml @@ -7,6 +7,7 @@ xmlns:avalonia_converters="using:Avalonia.Data.Converters" xmlns:i="using:Avalonia.Xaml.Interactivity" xmlns:ia="using:Avalonia.Xaml.Interactions.Custom" + xmlns:local="using:GSS2" xmlns:core="using:GSS2.UI.Core" xmlns:core_vm="using:GSS2.UI.Core.ViewModels" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -152,23 +153,23 @@ - + - + - + - + - + @@ -196,23 +197,23 @@ - + - + - + - + - + @@ -228,7 +229,7 @@ - + diff --git a/GSS2/Views/AmineContent/SeparatorCalibrationView.axaml b/GSS2/Views/AmineContent/SeparatorCalibrationView.axaml index 30e06db..bd8654e 100644 --- a/GSS2/Views/AmineContent/SeparatorCalibrationView.axaml +++ b/GSS2/Views/AmineContent/SeparatorCalibrationView.axaml @@ -7,6 +7,7 @@ xmlns:avalonia_converters="using:Avalonia.Data.Converters" xmlns:i="using:Avalonia.Xaml.Interactivity" xmlns:ia="using:Avalonia.Xaml.Interactions.Custom" + xmlns:local="using:GSS2" xmlns:core="using:GSS2.UI.Core" xmlns:core_vm="using:GSS2.UI.Core.ViewModels" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -123,11 +124,11 @@ - + - +