Skip to content

Commit 57206f4

Browse files
authored
material navigationBar's default back arrow (#1228)
1 parent c17a158 commit 57206f4

File tree

6 files changed

+141
-58
lines changed

6 files changed

+141
-58
lines changed

doc/controls/NavigationBar.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,14 @@ If no `MainCommand` is provided in the XAML, the `NavigationBar` will render the
312312

313313
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.
314314

315-
> [!WARNING]
316-
> 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`.
315+
> [!NOTE]
316+
> 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:
317+
>
318+
>```xml
319+
><Application.Resources>
320+
> <x:String x:Key="NavigationBarBackIconData">YOUR_CUSTOM_PATH_DATA</x:String>
321+
></Application.Resources>
322+
>```
317323
318324
### MainCommand Properties
319325
@@ -414,6 +420,7 @@ Only supports `BitmapImage` on iOS/Android
414420
| `NavigationBarFontFamily` | `FontFamily` | TitleLargeFontFamily |
415421
| `NavigationBarFontWeight` | `String` | TitleLargeFontWeight |
416422
| `NavigationBarFontSize` | `Double` | TitleLargeFontSize |
423+
| `NavigationBarBackIconData` | `String` | NavigationBarBackIconData |
417424
| `MaterialModalNavigationBarMainCommandForeground` | `SolidColorBrush` | OnSurfaceBrush |
418425
| `MaterialModalNavigationBarForeground` | `SolidColorBrush` | OnSurfaceBrush |
419426
| `MaterialModalNavigationBarBackground` | `SolidColorBrush` | SurfaceBrush |

samples/Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.6" />
2424
<PackageVersion Include="Uno.Core.Extensions.Compatibility" Version="4.0.1" />
2525
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
26-
<PackageVersion Include="Uno.Cupertino" Version="4.2.0-dev.17" />
27-
<PackageVersion Include="Uno.Cupertino.WinUI" Version="4.2.0-dev.17" />
26+
<PackageVersion Include="Uno.Cupertino" Version="5.3.0-dev.4" />
27+
<PackageVersion Include="Uno.Cupertino.WinUI" Version="5.3.0-dev.4" />
2828
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.8.0-dev.1" />
2929
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.8.0-dev.1" />
30-
<PackageVersion Include="Uno.Material" Version="4.2.0-dev.17" />
31-
<PackageVersion Include="Uno.Material.WinUI" Version="4.2.0-dev.17" />
30+
<PackageVersion Include="Uno.Material" Version="5.3.0-dev.4" />
31+
<PackageVersion Include="Uno.Material.WinUI" Version="5.3.0-dev.4" />
3232
<PackageVersion Include="Uno.UI" Version="5.4.0-dev.738" />
3333
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.4.0-dev.738" />
3434
<PackageVersion Include="Uno.UI.RemoteControl" Version="5.4.0-dev.738" />

samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<CupertinoToolkitResources xmlns="using:Uno.Toolkit.UI.Cupertino" />
2525

2626
<!-- Load application resources -->
27-
<ResourceDictionary Source="Converters.xaml" />
27+
<ResourceDictionary Source="ms-appx:///Converters.xaml" />
2828
<ResourceDictionary Source="ms-appx:///Styles/Application/Colors.xaml" />
2929
<ResourceDictionary Source="ms-appx:///Styles/Application/Fonts.xaml" />
3030
<ResourceDictionary Source="ms-appx:///Styles/Button.xaml" />

samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_NestedPage1.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
<utu:NavigationBar.MainCommand>
2121
<AppBarButton Label="Close"
2222
Click="NavigateBack"
23-
AutomationProperties.AutomationId="M3_NavBar_Close_Button"
24-
Style="{StaticResource MaterialAppBarButtonStyle}">
23+
AutomationProperties.AutomationId="M3_NavBar_Close_Button">
2524
<AppBarButton.Icon>
2625
<BitmapIcon UriSource="ms-appx:///Assets/CloseIcon.png" />
2726
</AppBarButton.Icon>

samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Uno.Toolkit.Samples.Shared.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,4 +583,4 @@
583583
<Content Include="$(MSBuildThisFileDirectory)Assets\Media\SmallMedia.scale-400.png" />
584584
<Content Include="$(MSBuildThisFileDirectory)Assets\UnoLogo.png" />
585585
</ItemGroup>
586-
</Project>
586+
</Project>

0 commit comments

Comments
 (0)