Windows.UI.Xaml.Controls.PathIcon
March 5, 2022 · View on GitHub
-description
Represents an icon that uses a vector path as its content.
-xaml-syntax
<PathIcon .../>
-remarks
Note
You can set the Foreground property on the AppBarButton or on the PathIcon. If you set the Foreground on the AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the AppBarButton template, like MouseOver. If you set the Foreground on the PathIcon, the color is applied to all visual states.
-examples
Tip
For more info, design guidance, and code examples, see Command bar.
If you have the WinUI 2 Gallery app installed, click here to open the app and see the PathIcon in action.
This example shows an AppBarButton with a PathIcon.
<!-- App bar button with path icon. -->
<AppBarButton Label="PathIcon" Click="AppBarButton_Click">
<AppBarButton.Icon>
<PathIcon Data="F1 M 16,12 20,2L 20,16 1,16" HorizontalAlignment="Center"/>
</AppBarButton.Icon>
</AppBarButton>
-see-also
IconElement, AppBarButton, Path, Move and draw commands syntax, Icons for UWP apps