diff --git a/RomRepoMgr.Core/EventArgs/RomSetsEventArgs.cs b/RomRepoMgr.Core/EventArgs/RomSetsEventArgs.cs new file mode 100644 index 0000000..7fcfaaf --- /dev/null +++ b/RomRepoMgr.Core/EventArgs/RomSetsEventArgs.cs @@ -0,0 +1,35 @@ +/****************************************************************************** +// 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 +*******************************************************************************/ + +using System.Collections.Generic; +using RomRepoMgr.Core.Models; + +namespace RomRepoMgr.Core.EventArgs +{ + public sealed class RomSetEventArgs : System.EventArgs + { + public List RomSets { get; set; } + } +} \ No newline at end of file diff --git a/RomRepoMgr/Models/AssemblyModel.cs b/RomRepoMgr.Core/Models/AssemblyModel.cs similarity index 97% rename from RomRepoMgr/Models/AssemblyModel.cs rename to RomRepoMgr.Core/Models/AssemblyModel.cs index 02ee441..6a1457f 100644 --- a/RomRepoMgr/Models/AssemblyModel.cs +++ b/RomRepoMgr.Core/Models/AssemblyModel.cs @@ -23,7 +23,7 @@ // Copyright © 2020 Natalia Portillo *******************************************************************************/ -namespace RomRepoMgr.Models +namespace RomRepoMgr.Core.Models { public sealed class AssemblyModel { diff --git a/RomRepoMgr/Models/RomSetModel.cs b/RomRepoMgr.Core/Models/RomSetModel.cs similarity index 98% rename from RomRepoMgr/Models/RomSetModel.cs rename to RomRepoMgr.Core/Models/RomSetModel.cs index 36065b1..0ae8908 100644 --- a/RomRepoMgr/Models/RomSetModel.cs +++ b/RomRepoMgr.Core/Models/RomSetModel.cs @@ -23,7 +23,7 @@ // Copyright © 2020 Natalia Portillo *******************************************************************************/ -namespace RomRepoMgr.Models +namespace RomRepoMgr.Core.Models { public class RomSetModel { diff --git a/RomRepoMgr/App.xaml.cs b/RomRepoMgr/App.xaml.cs index 4874f9e..b927c9c 100644 --- a/RomRepoMgr/App.xaml.cs +++ b/RomRepoMgr/App.xaml.cs @@ -29,7 +29,8 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using RomRepoMgr.Models; +using RomRepoMgr.Core.EventArgs; +using RomRepoMgr.Core.Models; using RomRepoMgr.ViewModels; using RomRepoMgr.Views; @@ -56,7 +57,7 @@ namespace RomRepoMgr base.OnFrameworkInitializationCompleted(); } - void OnGotRomSets(object sender, SplashWindowViewModel.RomSetEventArgs e) => _romSets = e.RomSets; + void OnGotRomSets(object sender, RomSetEventArgs e) => _romSets = e.RomSets; void OnSplashFinished(object sender, EventArgs e) { diff --git a/RomRepoMgr/RomRepoMgr.csproj b/RomRepoMgr/RomRepoMgr.csproj index 4d99190..a06c871 100644 --- a/RomRepoMgr/RomRepoMgr.csproj +++ b/RomRepoMgr/RomRepoMgr.csproj @@ -4,7 +4,6 @@ netcoreapp3.1 - %(Filename) diff --git a/RomRepoMgr/ViewModels/AboutViewModel.cs b/RomRepoMgr/ViewModels/AboutViewModel.cs index d67b53e..dd0ba30 100644 --- a/RomRepoMgr/ViewModels/AboutViewModel.cs +++ b/RomRepoMgr/ViewModels/AboutViewModel.cs @@ -33,7 +33,7 @@ using System.Threading.Tasks; using JetBrains.Annotations; using Microsoft.DotNet.PlatformAbstractions; using ReactiveUI; -using RomRepoMgr.Models; +using RomRepoMgr.Core.Models; using RomRepoMgr.Views; namespace RomRepoMgr.ViewModels diff --git a/RomRepoMgr/ViewModels/MainWindowViewModel.cs b/RomRepoMgr/ViewModels/MainWindowViewModel.cs index 6d35e73..0e4c3a4 100644 --- a/RomRepoMgr/ViewModels/MainWindowViewModel.cs +++ b/RomRepoMgr/ViewModels/MainWindowViewModel.cs @@ -30,7 +30,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using ReactiveUI; -using RomRepoMgr.Models; +using RomRepoMgr.Core.Models; using RomRepoMgr.Views; namespace RomRepoMgr.ViewModels @@ -116,8 +116,9 @@ namespace RomRepoMgr.ViewModels if(result?.Length != 1) return; - var dialog = new ImportDat(); - dialog.DataContext = new ImportDatViewModel(dialog, result[0]); + var dialog = new ImportDat(); + var importDatViewModel = new ImportDatViewModel(dialog, result[0]); + dialog.DataContext = importDatViewModel; await dialog.ShowDialog(_view); } } diff --git a/RomRepoMgr/ViewModels/SplashWindowViewModel.cs b/RomRepoMgr/ViewModels/SplashWindowViewModel.cs index 20566bd..44f47e5 100644 --- a/RomRepoMgr/ViewModels/SplashWindowViewModel.cs +++ b/RomRepoMgr/ViewModels/SplashWindowViewModel.cs @@ -24,7 +24,6 @@ *******************************************************************************/ using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Reactive; @@ -34,8 +33,9 @@ using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Threading; using Microsoft.EntityFrameworkCore; using ReactiveUI; +using RomRepoMgr.Core.EventArgs; +using RomRepoMgr.Core.Models; using RomRepoMgr.Database; -using RomRepoMgr.Models; namespace RomRepoMgr.ViewModels { @@ -352,10 +352,5 @@ namespace RomRepoMgr.ViewModels internal event EventHandler WorkFinished; internal event EventHandler GotRomSets; - - public sealed class RomSetEventArgs : EventArgs - { - public List RomSets { get; set; } - } } } \ No newline at end of file