Minor UX tweaks for icons + color sections - #1725
Conversation
|
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.
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 😄! |
| Visibility="Collapsed"> | ||
| <StackPanel> | ||
| <FontIcon | ||
| Margin="0,12,0,24" |
Co-authored-by: Zakaria Tahri <101801384+Zakariathr22@users.noreply.github.com>
Co-authored-by: Zakaria Tahri <101801384+Zakariathr22@users.noreply.github.com>
Co-authored-by: Zakaria Tahri <101801384+Zakariathr22@users.noreply.github.com>
| AutomationProperties.Name="How to use the font" | ||
| ContentAlignment="Left"> | ||
| <StackPanel Orientation="Vertical" Spacing="8"> | ||
| <RichTextBlock TextWrapping="Wrap"> |
|
/azp run |
|
/azp run |



This PR introduces the following changes:
ItemsViewwithout buttons, for better accessibility. Using aWrapLayout(from the WCT) so labels are not cut off.