mainfish#9
Open
frenchfish wants to merge 3 commits into
Open
Conversation
furesoft
requested changes
Jul 24, 2026
Comment on lines
+29
to
+40
| [ObservableProperty] private CoverArtImage? _coverArtImage; | ||
| [ObservableProperty] private Manual? _manual; | ||
| [ObservableProperty] private RomFile? _romFile; | ||
| [ObservableProperty] private SaveGame? _saveGame; | ||
| [ObservableProperty] private Screenshot? _screenshot; | ||
| [ObservableProperty] private State[] _state; | ||
| [ObservableProperty] private TitleScreen? _titleScreen; | ||
| [ObservableProperty] private Video _video; | ||
| //probably delete | ||
| [ObservableProperty] private bool _showLogo = false ; | ||
| [ObservableProperty] private Bitmap? _favouritePAth; | ||
| [ObservableProperty] private bool? _isFavourite = false; |
Owner
There was a problem hiding this comment.
- Don't introduce new properties
- Don't make a new property for binding "_isFavourite" use
Info.IsFavorite
Comment on lines
+49
to
+57
| Uri uri; | ||
| if (IsFavourite == true) | ||
| { | ||
| uri = new Uri("avares://RomManager/Assets/Icons/Games/favourite.png"); | ||
| } | ||
| else | ||
| { | ||
| uri = new Uri("avares://RomManager/Assets/Icons/Games/unfavourite.png"); | ||
| } |
Owner
There was a problem hiding this comment.
It is more common to use a converter here, like https://docs.avaloniaui.net/docs/data-binding/how-to-create-a-custom-data-binding-converter
furesoft
requested changes
Jul 25, 2026
Comment on lines
+16
to
+21
| private static readonly Dictionary<bool, string> FavouriteToIcon = new() | ||
| { | ||
| { true, "favourite" }, | ||
| { false, "unfavourite" }, | ||
|
|
||
| }; |
Owner
There was a problem hiding this comment.
Why do you use a dictionary for maximum of 2 values? It creates unneccesary allocations.
If you want to cache those images just use 2 IImage fields.
Comment on lines
+23
to
+30
| if (IsFavourite == true) | ||
| { | ||
| uri = new Uri("avares://RomManager/Assets/Icons/Games/favourite.png"); | ||
| } | ||
| else | ||
| { | ||
| uri = new Uri("avares://RomManager/Assets/Icons/Games/unfavourite.png"); | ||
| } |
Owner
There was a problem hiding this comment.
You could use something like this:
var iconName = IsFavourite ? "favourite" : "unfavourite";
var uri = new Uri($"avares://RomManager/Assets/Icons/Games/{iconName}.png");
Comment on lines
+76
to
+78
| //DELETE TEST | ||
| gameInfo = new GameInfo { Path = file, Name = System.IO.Path.GetFileNameWithoutExtension(file),IsFavorite = false}; | ||
| // gameInfo = new GameInfo { Path = file, Name = System.IO.Path.GetFileNameWithoutExtension(file) }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added favourite