mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate encodings from Eto.Forms to Avalonia.
This commit is contained in:
61
Aaru.Gui/Views/EncodingsDialog.xaml
Normal file
61
Aaru.Gui/Views/EncodingsDialog.xaml
Normal file
@@ -0,0 +1,61 @@
|
||||
<!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
//
|
||||
// Filename : dlgEncodings.xeto
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Encodings dialog.
|
||||
//
|
||||
// ==[ Description ] ==========================================================
|
||||
//
|
||||
// Defines the structure for the encodings list dialog.
|
||||
//
|
||||
// ==[ License ] ==============================================================
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright © 2011-2020 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
<Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="clr-namespace:Aaru.Gui.ViewModels;assembly=Aaru.Gui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="800"
|
||||
d:DesignHeight="450" Width="480" Height="320" x:Class="Aaru.Gui.Views.EncodingsDialog"
|
||||
Icon="/Assets/avalonia-logo.ico" CanResize="False" Title="{Binding Title}">
|
||||
<Design.DataContext>
|
||||
<vm:EncodingsDialogViewModel />
|
||||
</Design.DataContext>
|
||||
<Border Padding="15">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="260" /> <RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid Items="{Binding Encodings}" HorizontalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Code" Binding="{Binding Name}" Width="Auto" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding DisplayName}" Width="Auto" IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Border Grid.Row="1" Padding="10">
|
||||
<Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Command="{Binding CloseCommand}">
|
||||
<TextBlock Text="{Binding CloseLabel}" />
|
||||
</Button>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
19
Aaru.Gui/Views/EncodingsDialog.xaml.cs
Normal file
19
Aaru.Gui/Views/EncodingsDialog.xaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Aaru.Gui.Views
|
||||
{
|
||||
public class EncodingsDialog : Window
|
||||
{
|
||||
public EncodingsDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@
|
||||
<MenuItem Header="_Console" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Help">
|
||||
<MenuItem Header="_Encodings" /> <MenuItem Header="_Plugins" /> <MenuItem Header="_Statistics" />
|
||||
<Separator IsVisible="{Binding NativeMenuNotSupported}" />
|
||||
<MenuItem Header="_Encodings" Command="{Binding EncodingsCommand}" /> <MenuItem Header="_Plugins" />
|
||||
<MenuItem Header="_Statistics" /> <Separator IsVisible="{Binding NativeMenuNotSupported}" />
|
||||
<MenuItem Header="_About" Name="AboutMenuItem" IsVisible="{Binding NativeMenuNotSupported}"
|
||||
Command="{Binding AboutCommand}" />
|
||||
</MenuItem>
|
||||
|
||||
Reference in New Issue
Block a user