From 899590432a6d4f7eb7edd109e727b8dcea485790 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 22 Aug 2020 03:26:43 +0100 Subject: [PATCH] Add list of ROM sets to main window. --- RomRepoMgr/Models/RomSetModel.cs | 33 ++++++++++++++++++++ RomRepoMgr/ViewModels/MainWindowViewModel.cs | 8 +++++ RomRepoMgr/Views/MainWindow.xaml | 16 +++++++++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 RomRepoMgr/Models/RomSetModel.cs diff --git a/RomRepoMgr/Models/RomSetModel.cs b/RomRepoMgr/Models/RomSetModel.cs new file mode 100644 index 0000000..6e8e2db --- /dev/null +++ b/RomRepoMgr/Models/RomSetModel.cs @@ -0,0 +1,33 @@ +/****************************************************************************** +// RomRepoMgr - ROM repository manager +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2020 Natalia Portillo +*******************************************************************************/ + +namespace RomRepoMgr.Models +{ + public sealed class RomSetModel + { + public string Name { get; set; } + public string Version { get; set; } + } +} \ No newline at end of file diff --git a/RomRepoMgr/ViewModels/MainWindowViewModel.cs b/RomRepoMgr/ViewModels/MainWindowViewModel.cs index 0026bb7..cc30efd 100644 --- a/RomRepoMgr/ViewModels/MainWindowViewModel.cs +++ b/RomRepoMgr/ViewModels/MainWindowViewModel.cs @@ -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(); } + public ObservableCollection 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 diff --git a/RomRepoMgr/Views/MainWindow.xaml b/RomRepoMgr/Views/MainWindow.xaml index 710127e..39c87ec 100644 --- a/RomRepoMgr/Views/MainWindow.xaml +++ b/RomRepoMgr/Views/MainWindow.xaml @@ -19,6 +19,20 @@ Command="{Binding AboutCommand}" /> - + + + + + + + + + + + + + \ No newline at end of file