mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 11:14:45 +00:00
Update to Avalonia 11.2.0.
This commit is contained in:
@@ -6,18 +6,16 @@
|
||||
<local:ViewLocator />
|
||||
</Application.DataTemplates>
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://Avalonia.Themes.Default/DefaultTheme.xaml" />
|
||||
<StyleInclude Source="avares://Avalonia.Themes.Default/Accents/BaseLight.xaml" />
|
||||
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Default.xaml" />
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
<NativeMenu.Menu>
|
||||
<NativeMenu>
|
||||
<NativeMenuItem Header="_About"
|
||||
Clicked="OnAboutClicked" />
|
||||
Click="OnAboutClicked" />
|
||||
<NativeMenuItem Header="_Preferences"
|
||||
Clicked="OnPreferencesClicked" />
|
||||
Click="OnPreferencesClicked" />
|
||||
<NativeMenuItem Header="_Quit"
|
||||
Clicked="OnQuitClicked" />
|
||||
Click="OnQuitClicked" />
|
||||
</NativeMenu>
|
||||
</NativeMenu.Menu>
|
||||
</Application>
|
||||
@@ -24,6 +24,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Logging;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
namespace RomRepoMgr;
|
||||
@@ -36,6 +37,8 @@ internal class Program
|
||||
public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
|
||||
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
public static AppBuilder BuildAvaloniaApp() =>
|
||||
AppBuilder.Configure<App>().UsePlatformDetect().LogToDebug().UseReactiveUI();
|
||||
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.LogToTrace(LogEventLevel.Debug)
|
||||
.UseReactiveUI();
|
||||
}
|
||||
@@ -19,13 +19,14 @@
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="0.10.0-rc1"/>
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.0-rc1"/>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="0.10.0-rc1"/>
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.0-rc1"/>
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0-rc1"/>
|
||||
<PackageReference Include="Avalonia" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.Svg.Skia" Version="11.2.0"/>
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.0"/>
|
||||
<PackageReference Include="MessageBox.Avalonia" Version="0.10.7-rc1"/>
|
||||
<PackageReference Include="Svg.Skia.Avalonia" Version="0.10.0-preview7"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RomRepoMgr.Database\RomRepoMgr.Database.csproj"/>
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ViewLocator : IDataTemplate
|
||||
{
|
||||
public bool SupportsRecycling => false;
|
||||
|
||||
public IControl Build(object data)
|
||||
public Control Build(object data)
|
||||
{
|
||||
string name = data.GetType().FullName?.Replace("ViewModel", "View");
|
||||
Type type = name is null ? null : Type.GetType(name);
|
||||
|
||||
@@ -31,7 +31,7 @@ using System.Reactive;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Avalonia.Threading;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.Resources;
|
||||
@@ -71,45 +71,35 @@ public sealed class AboutViewModel : ViewModelBase
|
||||
|
||||
if(name is null || version is null) continue;
|
||||
|
||||
Assemblies.Add(new AssemblyModel
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
Name = name,
|
||||
Version = version
|
||||
Assemblies.Add(new AssemblyModel
|
||||
{
|
||||
Name = name,
|
||||
Version = version
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string AboutLabel => Localization.AboutLabel;
|
||||
[NotNull]
|
||||
public string LibrariesLabel => Localization.LibrariesLabel;
|
||||
[NotNull]
|
||||
public string AuthorsLabel => Localization.AuthorsLabel;
|
||||
[NotNull]
|
||||
public string Title => Localization.AboutTitle;
|
||||
[NotNull]
|
||||
public string SoftwareName => "RomRepoMgr";
|
||||
[NotNull]
|
||||
public string SuiteName => "ROM Repository Manager";
|
||||
[NotNull]
|
||||
public string Copyright => "© 2020-2024 Natalia Portillo";
|
||||
[NotNull]
|
||||
public string Website => "https://www.claunia.com";
|
||||
[NotNull]
|
||||
public string License => Localization.LicenseLabel;
|
||||
[NotNull]
|
||||
public string CloseLabel => Localization.CloseLabel;
|
||||
[NotNull]
|
||||
public string AssembliesLibraryText => Localization.AssembliesLibraryText;
|
||||
[NotNull]
|
||||
public string AssembliesVersionText => Localization.AssembliesVersionText;
|
||||
[NotNull]
|
||||
public string Authors => Localization.AuthorsText;
|
||||
public ReactiveCommand<Unit, Unit> WebsiteCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> LicenseCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
||||
public ObservableCollection<AssemblyModel> Assemblies { get; }
|
||||
public string AboutLabel => Localization.AboutLabel;
|
||||
public string LibrariesLabel => Localization.LibrariesLabel;
|
||||
public string AuthorsLabel => Localization.AuthorsLabel;
|
||||
public string Title => Localization.AboutTitle;
|
||||
public string SoftwareName => "RomRepoMgr";
|
||||
public string SuiteName => "ROM Repository Manager";
|
||||
public string Copyright => "© 2020-2024 Natalia Portillo";
|
||||
public string Website => "https://www.claunia.com";
|
||||
public string License => Localization.LicenseLabel;
|
||||
public string CloseLabel => Localization.CloseLabel;
|
||||
public string AssembliesLibraryText => Localization.AssembliesLibraryText;
|
||||
public string AssembliesVersionText => Localization.AssembliesVersionText;
|
||||
public string Authors => Localization.AuthorsText;
|
||||
public ReactiveCommand<Unit, Unit> WebsiteCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> LicenseCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
||||
public ObservableCollection<AssemblyModel> Assemblies { get; }
|
||||
|
||||
public string VersionText
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
@@ -63,7 +62,6 @@ public sealed class ExportDatViewModel : ViewModelBase
|
||||
_worker.FailedWithText += OnWorkerOnFailedWithText;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.ExportDatTitle;
|
||||
|
||||
public string StatusMessage
|
||||
|
||||
@@ -27,7 +27,6 @@ using System;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Workers;
|
||||
@@ -69,8 +68,7 @@ public sealed class ExportRomsViewModel : ViewModelBase
|
||||
CanClose = false;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string PathLabel => Localization.PathLabel;
|
||||
public string PathLabel => Localization.PathLabel;
|
||||
public string FolderPath { get; }
|
||||
|
||||
public bool ProgressVisible
|
||||
@@ -181,9 +179,7 @@ public sealed class ExportRomsViewModel : ViewModelBase
|
||||
set => this.RaiseAndSetIfChanged(ref _progress3IsIndeterminate, value);
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.ExportRomsTitle;
|
||||
[NotNull]
|
||||
public string Title => Localization.ExportRomsTitle;
|
||||
public string CloseLabel => Localization.CloseLabel;
|
||||
|
||||
public bool CanClose
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Workers;
|
||||
@@ -192,7 +191,6 @@ public sealed class ImportDatFolderViewModel : ViewModelBase
|
||||
set => this.RaiseAndSetIfChanged(ref _category, value);
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.ImportDatFolderTitle;
|
||||
|
||||
public ObservableCollection<ImportDatFolderItem> ImportResults { get; }
|
||||
|
||||
@@ -27,7 +27,6 @@ using System;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Workers;
|
||||
@@ -66,7 +65,6 @@ public sealed class ImportDatViewModel : ViewModelBase
|
||||
_worker.WorkFinished += OnWorkerOnWorkFinished;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.ImportDatTitle;
|
||||
|
||||
public string StatusMessage
|
||||
|
||||
@@ -28,7 +28,6 @@ using System.Collections.ObjectModel;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Models;
|
||||
@@ -199,7 +198,6 @@ public sealed class ImportRomFolderViewModel : ViewModelBase
|
||||
set => this.RaiseAndSetIfChanged(ref _isImporting, value);
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.ImportRomFolderTitle;
|
||||
|
||||
public ObservableCollection<ImportRomItem> ImportResults { get; }
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core;
|
||||
using RomRepoMgr.Database;
|
||||
@@ -48,7 +47,6 @@ public sealed class RemoveDatViewModel : ViewModelBase
|
||||
_romSetId = romSetId;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.RemoveDatTitle;
|
||||
|
||||
public string StatusMessage
|
||||
|
||||
@@ -29,7 +29,6 @@ using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using MessageBox.Avalonia;
|
||||
using MessageBox.Avalonia.Enums;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -150,7 +149,7 @@ public sealed class SettingsViewModel : ViewModelBase
|
||||
Task.Run(() => worker.CheckUnAr(UnArPath));
|
||||
}
|
||||
|
||||
async void CheckUnArFailed(object sender, [NotNull] ErrorEventArgs args)
|
||||
async void CheckUnArFailed(object sender, ErrorEventArgs args)
|
||||
{
|
||||
UnArVersion = "";
|
||||
UnArPath = "";
|
||||
|
||||
@@ -29,7 +29,6 @@ using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.Models;
|
||||
@@ -61,8 +60,7 @@ public sealed class UpdateStatsViewModel : ViewModelBase
|
||||
RomSets = new ObservableCollection<RomSetModel>();
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
public string Title => Localization.UpdateStatsTitle;
|
||||
public string Title => Localization.UpdateStatsTitle;
|
||||
public string RomSetNameLabel => Localization.RomSetNameLabel;
|
||||
public string RomSetVersionLabel => Localization.RomSetVersionLabel;
|
||||
public string RomSetAuthorLabel => Localization.RomSetAuthorLabel;
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding LibrariesLabel}" />
|
||||
</TabItem.Header>
|
||||
<DataGrid Items="{Binding Assemblies}"
|
||||
<DataGrid ItemsSource="{Binding Assemblies}"
|
||||
HorizontalScrollBarVisibility="Visible">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Name}"
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
IsIndeterminate="{Binding Progress2IsIndeterminate}" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="7"
|
||||
Items="{Binding ImportResults}"
|
||||
ItemsSource="{Binding ImportResults}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
IsVisible="{Binding IsImporting}">
|
||||
<DataGrid.Columns>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
IsIndeterminate="{Binding Progress2IsIndeterminate}" />
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="7"
|
||||
Items="{Binding ImportResults}"
|
||||
ItemsSource="{Binding ImportResults}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
IsVisible="{Binding IsImporting}">
|
||||
<DataGrid.Columns>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding RomSetLabel}" />
|
||||
</TabItem.Header>
|
||||
<DataGrid Items="{Binding RomSets}"
|
||||
<DataGrid ItemsSource="{Binding RomSets}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
SelectedItem="{Binding SelectedRomSet, Mode=TwoWay}"
|
||||
CanUserSortColumns="True"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:vm="clr-namespace:RomRepoMgr.ViewModels;assembly=RomRepoMgr"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:svg="clr-namespace:Svg.Skia.Avalonia;assembly=Svg.Skia.Avalonia"
|
||||
xmlns:svg="clr-namespace:Avalonia.Svg.Skia;assembly=Avalonia.Svg.Skia"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="450"
|
||||
d:DesignHeight="250"
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
IsVisible="{Binding ProgressVisible}" />
|
||||
<DataGrid Grid.Row="2"
|
||||
Items="{Binding RomSets}"
|
||||
ItemsSource="{Binding RomSets}"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
SelectedItem="{Binding SelectedRomSet, Mode=TwoWay}"
|
||||
CanUserSortColumns="True"
|
||||
|
||||
Reference in New Issue
Block a user