unoplatform / uno.toolkit.ui

A set of custom controls for the WinUI and the Uno Platform not offered out of the box by WinUI, such as Card, TabBar, NavigationBar, etc.
https://platform.uno/
MIT License
82 stars 27 forks source link

[Material] Default NavigationBar's MainCommand with a PathIcon for a back arrow #1227

Closed kazo0 closed 1 month ago

kazo0 commented 2 months ago

The Material styles for the NavigationBar should utilize a PathIcon with a back arrow icon as the default MainCommand for all platforms except for mobile.

NOTE: We CANNOT use the Icon Setter on the MainCommandStyle, the PathIcon MUST be declared directly in the ControlTemplate, the same way it is done for NavigationView in Fluent here:

See how in NavigationView's template it uses a Button with a specific style: https://github.com/unoplatform/uno/blob/6bb40b428855f8b36e3fb1fea937f054d88ae620/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView.xaml#L646

And the Style uses a hardcoded icon in the template: https://github.com/unoplatform/uno/blob/6bb40b428855f8b36e3fb1fea937f054d88ae620/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationBackButton.xaml#L67-L75

We should have a specific MaterialMainCommandStyle that re-templates the MaterialAppBarButtonStyle and uses a hardcoded PathIcon as the content

kazo0 commented 2 months ago

I think we can do something like highjack the Content property and allow people to set it as the Path Data, that way we can have multiple MainCommandStyles like the default one with a Back arrow and another like a CloseMainCommandStyle or something that sets the data to a X icon