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.
Updated promos logic to allow for up to 3 links per promo, and updated the YUR promo for the new format.
Screenshot:
This implementation is a bit gross, but this is the best way I could get this to work correctly.
In the future it may be worth using a more elegant solution, but it doesn't seem like this type of styling is easy to dynamically generate in this situation. My knowledge of WPF is limited, so there may be an easier way to do this that I've overlooked.
Before anyone tries to go down that rabbit hole like I did, here's what I tried:
Access the mod's StackPanel directly to inject the promo elements when needed
It is possible to find elements by name using
rootElementName.FindName("nameToFind")
, but the element would need a unique name in the list.Unfortunately, it is not possible to set the name programmatically through xaml, such as with
Name="{Binding ModName}"
.I think this would be possible if the xaml for the list were generated from the C# code, but it would require reworking a lot of MA.
Using a different WPF element other than TextBlock
Using a different element still runs into the same issue as above, and the hyperlinks would still need to be their own child elements.