diff --git a/Marechai.App/Presentation/ViewModels/GpuDetailViewModel.cs b/Marechai.App/Presentation/ViewModels/GpuDetailViewModel.cs index 46773d9d..43e2b40d 100644 --- a/Marechai.App/Presentation/ViewModels/GpuDetailViewModel.cs +++ b/Marechai.App/Presentation/ViewModels/GpuDetailViewModel.cs @@ -64,6 +64,9 @@ public partial class GpuDetailViewModel : ObservableObject, IRegionAware [ObservableProperty] private int _gpuId; + [ObservableProperty] + private string _displayName = string.Empty; + [ObservableProperty] private bool _hasComputers; @@ -82,6 +85,9 @@ public partial class GpuDetailViewModel : ObservableObject, IRegionAware [ObservableProperty] private Visibility _showPhotos = Visibility.Collapsed; + [ObservableProperty] + private Visibility _showSpecifications = Visibility.Visible; + [ObservableProperty] private Visibility _showVideos = Visibility.Collapsed; @@ -169,8 +175,11 @@ public partial class GpuDetailViewModel : ObservableObject, IRegionAware Videos.Clear(); ShowPhotos = Visibility.Collapsed; ShowVideos = Visibility.Collapsed; + ShowDescription = Visibility.Collapsed; + ShowSpecifications = Visibility.Visible; + DisplayName = string.Empty; - if(GpuId <= 0) + if(GpuId == 0) { ErrorMessage = _localizer["Invalid GPU ID"].Value; HasError = true; @@ -216,6 +225,9 @@ public partial class GpuDetailViewModel : ObservableObject, IRegionAware displayName = _localizer["Software"]; else if(displayName == "DB_NONE") displayName = _localizer["None_female"]; + DisplayName = displayName; + ShowSpecifications = IsSentinelGpu(Gpu) ? Visibility.Collapsed : Visibility.Visible; + _logger.LogInformation("GPU loaded: {Name}, Company: {Company}", displayName, ManufacturerName); // Load resolutions @@ -463,6 +475,9 @@ public partial class GpuDetailViewModel : ObservableObject, IRegionAware } } + static bool IsSentinelGpu(GpuDto? gpu) => + gpu?.Name is "DB_FRAMEBUFFER" or "DB_SOFTWARE" or "DB_NONE"; + /// /// Navigates back to the GPU list /// diff --git a/Marechai.App/Presentation/ViewModels/SoundSynthDetailViewModel.cs b/Marechai.App/Presentation/ViewModels/SoundSynthDetailViewModel.cs index 4d20fafe..d37324e6 100644 --- a/Marechai.App/Presentation/ViewModels/SoundSynthDetailViewModel.cs +++ b/Marechai.App/Presentation/ViewModels/SoundSynthDetailViewModel.cs @@ -72,12 +72,18 @@ public partial class SoundSynthDetailViewModel : ObservableObject, IRegionAware [ObservableProperty] private string _descriptionHtml = string.Empty; + [ObservableProperty] + private string _displayName = string.Empty; + [ObservableProperty] private Visibility _showDescription = Visibility.Collapsed; [ObservableProperty] private Visibility _showPhotos = Visibility.Collapsed; + [ObservableProperty] + private Visibility _showSpecifications = Visibility.Visible; + [ObservableProperty] private Visibility _showVideos = Visibility.Collapsed; @@ -172,8 +178,11 @@ public partial class SoundSynthDetailViewModel : ObservableObject, IRegionAware Videos.Clear(); ShowPhotos = Visibility.Collapsed; ShowVideos = Visibility.Collapsed; + ShowDescription = Visibility.Collapsed; + ShowSpecifications = Visibility.Visible; + DisplayName = string.Empty; - if(SoundSynthId <= 0) + if(SoundSynthId == 0) { ErrorMessage = _localizer["Invalid Sound Synthesizer ID"].Value; HasError = true; @@ -214,8 +223,11 @@ public partial class SoundSynthDetailViewModel : ObservableObject, IRegionAware } } + DisplayName = LocalizeSpecialSoundSynthName(SoundSynth.Name); + ShowSpecifications = IsSentinelSoundSynth(SoundSynth) ? Visibility.Collapsed : Visibility.Visible; + _logger.LogInformation("Sound Synthesizer loaded: {Name}, Company: {Company}", - SoundSynth.Name, + DisplayName, ManufacturerName); // Load machines and separate into computers and consoles @@ -423,6 +435,14 @@ public partial class SoundSynthDetailViewModel : ObservableObject, IRegionAware } } + static bool IsSentinelSoundSynth(SoundSynthDto? soundSynth) => soundSynth?.Name == "DB_SOFTWARE"; + + string LocalizeSpecialSoundSynthName(string? name) => name switch + { + "DB_SOFTWARE" => _localizer["Software"], + _ => name ?? string.Empty + }; + /// /// Navigates back to the Sound Synthesizer list /// diff --git a/Marechai.App/Presentation/Views/GpuDetailPage.xaml b/Marechai.App/Presentation/Views/GpuDetailPage.xaml index 85d10370..dde7a288 100644 --- a/Marechai.App/Presentation/Views/GpuDetailPage.xaml +++ b/Marechai.App/Presentation/Views/GpuDetailPage.xaml @@ -70,185 +70,186 @@ Spacing="16"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + TextWrapping="Wrap" /> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Marechai.App/Presentation/Views/SoundSynthDetailPage.xaml b/Marechai.App/Presentation/Views/SoundSynthDetailPage.xaml index efc6d266..02d84b81 100644 --- a/Marechai.App/Presentation/Views/SoundSynthDetailPage.xaml +++ b/Marechai.App/Presentation/Views/SoundSynthDetailPage.xaml @@ -70,119 +70,122 @@ Spacing="16"> - - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + +