mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[TUI] Replace Window with ManagedWindow in GoToSectorDialog implementation
This commit is contained in:
@@ -26,27 +26,24 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Windows.Input;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Iciclecreek.Avalonia.WindowManager;
|
||||
|
||||
namespace Aaru.Tui.ViewModels.Dialogs;
|
||||
|
||||
public sealed partial class GoToSectorDialogViewModel : ViewModelBase
|
||||
{
|
||||
readonly ulong _maxSector;
|
||||
internal Window _dialog = null!;
|
||||
|
||||
readonly ulong _maxSector;
|
||||
internal ManagedWindow _dialog = null!;
|
||||
[ObservableProperty]
|
||||
string _errorMessage = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
bool _hasError;
|
||||
|
||||
[ObservableProperty]
|
||||
string _sectorNumber = string.Empty;
|
||||
|
||||
public GoToSectorDialogViewModel(Window dialog, ulong maxSector)
|
||||
public GoToSectorDialogViewModel(ManagedWindow dialog, ulong maxSector)
|
||||
{
|
||||
_dialog = dialog;
|
||||
_maxSector = maxSector;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Aaru.Tui.ViewModels.Dialogs"
|
||||
xmlns:brushes="https://github.com/jinek/consolonia"
|
||||
Width="40"
|
||||
Height="8"
|
||||
x:Class="Aaru.Tui.Views.Dialogs.GoToSectorDialog"
|
||||
x:DataType="vm:GoToSectorDialogViewModel"
|
||||
Title="Go to Sector"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
RequestedThemeVariant="Dark"
|
||||
CanResize="False">
|
||||
<windowManager:ManagedWindow xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Aaru.Tui.ViewModels.Dialogs"
|
||||
xmlns:brushes="https://github.com/jinek/consolonia"
|
||||
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
|
||||
Width="40"
|
||||
Height="8"
|
||||
x:Class="Aaru.Tui.Views.Dialogs.GoToSectorDialog"
|
||||
x:DataType="vm:GoToSectorDialogViewModel"
|
||||
Title="Go to Sector"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
CanResize="False">
|
||||
<Design.DataContext>
|
||||
<vm:GoToSectorDialogViewModel />
|
||||
</Design.DataContext>
|
||||
@@ -20,7 +20,7 @@
|
||||
</Border.BorderBrush>
|
||||
<StackPanel>
|
||||
<TextBlock Text="Enter sector number:" />
|
||||
<TextBox Text="{Binding SectorNumber, Mode=OneWay}"
|
||||
<TextBox Text="{Binding SectorNumber, Mode=TwoWay}"
|
||||
Watermark="Sector number" />
|
||||
<TextBlock Text="{Binding ErrorMessage, Mode=OneWay}"
|
||||
Foreground="Red"
|
||||
@@ -35,4 +35,4 @@
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Window>
|
||||
</windowManager:ManagedWindow>
|
||||
@@ -25,11 +25,11 @@
|
||||
// Copyright © 2011-2025 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Avalonia.Controls;
|
||||
using Iciclecreek.Avalonia.WindowManager;
|
||||
|
||||
namespace Aaru.Tui.Views.Dialogs;
|
||||
|
||||
public partial class GoToSectorDialog : Window
|
||||
public partial class GoToSectorDialog : ManagedWindow
|
||||
{
|
||||
public GoToSectorDialog()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user