-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor UX tweaks for icons + color sections #1725
base: main
Are you sure you want to change the base?
Conversation
Hi @niels9001, I believe there's a small issue. The actual tags for the {
"Code": "E72E",
"Name": "Lock",
"Tags": [
"private",
"security",
"access",
"protected",
"safety",
"permission",
"access",
"protection"
]
} However, the displayed tags don't match. It seems the app is showing the initial tags from the previously selected icon and then combining them with the remaining tags from the currently selected icon (you can compare the main branch with the new branch to observe the difference). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the issue arises from the WrapLayout
not correctly tracking changes in the items. This is what result in incorrect tags updates when the selected icon changes.
I suggest modifying the IconsItemsView_SelectionChanged
method as follows:
private void IconsItemsView_SelectionChanged(ItemsView sender, ItemsViewSelectionChangedEventArgs args)
{
if (IconsItemsView.ItemsSource is IList<IconData> currentItems)
{
if (IconsItemsView.CurrentItemIndex != -1 && IconsItemsView.CurrentItemIndex < currentItems.Count)
{
SelectedItem = currentItems[IconsItemsView.CurrentItemIndex];
}
}
if (TagsItemsView != null)
{
TagsItemsView.Layout = new WrapLayout { VerticalSpacing = 4, HorizontalSpacing = 4 };
}
}
This ensures that the layout for TagsItemsView
is refreshed whenever the selection changes. By reassigning a new instance of WrapLayout
with the same spacing values (VerticalSpacing = 4
, HorizontalSpacing = 4
), we effectively reset the layout. This forces the ItemsRepeater
to re-measure and re-arrange the items, ensuring it reflects the current data accurately.
Thanks.. something to follow up on with the Toolkit! Your workaround seems to work, thanks for the suggestion 😄! |
<StackPanel> | ||
<FontIcon | ||
Margin="0,12,0,24" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Zakaria Tahri <[email protected]>
Co-authored-by: Zakaria Tahri <[email protected]>
Co-authored-by: Zakaria Tahri <[email protected]>
<toolkit:SettingsCard | ||
Padding="16,8" | ||
AutomationProperties.Name="How to use the font" | ||
ContentAlignment="Left"> | ||
<StackPanel Orientation="Vertical" Spacing="8"> | ||
<RichTextBlock TextWrapping="Wrap"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces the following changes:
ItemsView
without buttons, for better accessibility. Using aWrapLayout
(from the WCT) so labels are not cut off.