mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Add list of ROM sets to main window.
This commit is contained in:
33
RomRepoMgr/Models/RomSetModel.cs
Normal file
33
RomRepoMgr/Models/RomSetModel.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
/******************************************************************************
|
||||
// RomRepoMgr - ROM repository manager
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ 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 © 2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
namespace RomRepoMgr.Models
|
||||
{
|
||||
public sealed class RomSetModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,13 @@
|
||||
// Copyright © 2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reactive;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Models;
|
||||
using RomRepoMgr.Views;
|
||||
|
||||
namespace RomRepoMgr.ViewModels
|
||||
@@ -42,8 +44,14 @@ namespace RomRepoMgr.ViewModels
|
||||
ExitCommand = ReactiveCommand.Create(ExecuteExitCommand);
|
||||
SettingsCommand = ReactiveCommand.Create(ExecuteSettingsCommand);
|
||||
AboutCommand = ReactiveCommand.Create(ExecuteAboutCommand);
|
||||
RomSets = new ObservableCollection<RomSetModel>();
|
||||
}
|
||||
|
||||
public ObservableCollection<RomSetModel> RomSets { get; }
|
||||
public string RomSetLabel => "ROM sets";
|
||||
public string RomSetNameLabel => "Name";
|
||||
public string RomSetVersionLabel => "Version";
|
||||
|
||||
public string Greeting => "Hello World!";
|
||||
public bool NativeMenuSupported =>
|
||||
NativeMenu.GetIsNativeMenuExported((Application.Current.ApplicationLifetime as
|
||||
|
||||
@@ -19,6 +19,20 @@
|
||||
Command="{Binding AboutCommand}" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<TabControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding RomSetLabel}" />
|
||||
</TabItem.Header>
|
||||
<DataGrid Items="{Binding RomSets}" HorizontalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{Binding RomSetNameLabel}" Binding="{Binding Name}" Width="Auto"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{Binding RomSetVersionLabel}" Binding="{Binding Version}"
|
||||
Width="Auto" IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user