diff --git a/doc/controls/NavigationBar.md b/doc/controls/NavigationBar.md index c230a6d8f..2aad310f4 100644 --- a/doc/controls/NavigationBar.md +++ b/doc/controls/NavigationBar.md @@ -312,8 +312,14 @@ If no `MainCommand` is provided in the XAML, the `NavigationBar` will render the On **Android**, only icons are supported (`AppBarButton.Icon`). This is due to a platform limitation, which can be explained by the fact that `NavigationBar.Content` is left-aligned. -> [!WARNING] -> Due to [platform limitations](https://github.com/microsoft/microsoft-ui-xaml/issues/1494) on Windows only, a default back button icon is not provided out of the box. You will need to provide your own icon on each instance of the `NavigationBar` where you want to display a back button. On Android and iOS, the native default back button icon is used. On all other platforms, a back button icon is bundled in the default styles for the `NavigationBar`. +> [!NOTE] +> The default back button icon can be customized for non-mobile platforms by overriding the `NavigationBarBackIconData` resource. On `Android` and `iOS`, the native default back button icon is used. On Windows and other non-mobile platforms, you can provide a custom back button icon by defining the `NavigationBarBackIconData` resource in your resource dictionary: +> +>```xml +> +> YOUR_CUSTOM_PATH_DATA +> +>``` ### MainCommand Properties @@ -414,6 +420,7 @@ Only supports `BitmapImage` on iOS/Android | `NavigationBarFontFamily` | `FontFamily` | TitleLargeFontFamily | | `NavigationBarFontWeight` | `String` | TitleLargeFontWeight | | `NavigationBarFontSize` | `Double` | TitleLargeFontSize | +| `NavigationBarBackIconData` | `String` | NavigationBarBackIconData | | `MaterialModalNavigationBarMainCommandForeground` | `SolidColorBrush` | OnSurfaceBrush | | `MaterialModalNavigationBarForeground` | `SolidColorBrush` | OnSurfaceBrush | | `MaterialModalNavigationBarBackground` | `SolidColorBrush` | SurfaceBrush | diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index c0c8cc7ac..354e6a4ee 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -23,12 +23,12 @@ - - + + - - + + diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml index e05e3d1fa..f06ffa840 100644 --- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml +++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml @@ -24,7 +24,7 @@ - + diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_NestedPage1.xaml b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_NestedPage1.xaml index bec826d47..eaf18c94f 100644 --- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_NestedPage1.xaml +++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_NestedPage1.xaml @@ -20,8 +20,7 @@ + AutomationProperties.AutomationId="M3_NavBar_Close_Button"> diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Uno.Toolkit.Samples.Shared.projitems b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Uno.Toolkit.Samples.Shared.projitems index 55d215598..f2548df04 100644 --- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Uno.Toolkit.Samples.Shared.projitems +++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Uno.Toolkit.Samples.Shared.projitems @@ -583,4 +583,4 @@ - + \ No newline at end of file diff --git a/src/library/Uno.Toolkit.Material/Styles/Controls/v2/NavigationBar.xaml b/src/library/Uno.Toolkit.Material/Styles/Controls/v2/NavigationBar.xaml index 1986a0523..23c07dac0 100644 --- a/src/library/Uno.Toolkit.Material/Styles/Controls/v2/NavigationBar.xaml +++ b/src/library/Uno.Toolkit.Material/Styles/Controls/v2/NavigationBar.xaml @@ -17,6 +17,7 @@ xmlns:not_win="http://uno.ui/not_win" xmlns:toolkit="using:Uno.UI.Toolkit" xmlns:um="using:Uno.Material" + xmlns:ut="using:Uno.Themes" xmlns:utu="using:Uno.Toolkit.UI" xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation" mc:Ignorable="android ios not_win mobile"> @@ -24,7 +25,7 @@ - + @@ -37,12 +38,12 @@ - + - + @@ -56,15 +57,23 @@ - + - + - + - + + + + + + + 4 64 @@ -77,7 +86,8 @@ - 24 + 16 + 24 56 12,16,12,16 @@ -116,12 +126,20 @@ - + - + + + + + + + 4 64 @@ -134,7 +152,8 @@ - 24 + 16 + 24 56 12,16,12,16 @@ -145,7 +164,7 @@ - - - - + Content="{Binding Path=(utu:CommandBarExtensions.MainCommand), RelativeSource={RelativeSource TemplatedParent}}" /> + - + @@ -376,7 +456,7 @@ - + @@ -429,7 +509,7 @@ - + @@ -477,7 +557,7 @@ - + @@ -757,11 +837,8 @@ - - - - + Content="{Binding Path=(utu:CommandBarExtensions.MainCommand), RelativeSource={RelativeSource TemplatedParent}}" /> + + - + @@ -848,7 +925,7 @@ - + @@ -901,7 +978,7 @@ - + @@ -949,7 +1026,7 @@ - +