Skip to content

Commit

Permalink
chore: fixing white spaces + updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunal22shah authored and kazo0 committed Sep 14, 2024
1 parent 8c7d05e commit 9f95f9e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
10 changes: 8 additions & 2 deletions doc/controls/NavigationBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,13 @@ 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
><Application.Resources>
> <x:String x:Key="NavigationBarBackIconData">YOUR_CUSTOM_PATH_DATA</x:String>
></Application.Resources>
>```
### MainCommand Properties
Expand Down Expand Up @@ -414,6 +419,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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@

<!--#region Default Material NavigationBar-->
<Style x:Key="MaterialMainCommandStyle"
TargetType="AppBarButton">
TargetType="AppBarButton">
<Setter Property="Background" Value="{ThemeResource AppBarButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource AppBarButtonForeground}" />
<Setter Property="BorderBrush" Value="{ThemeResource AppBarButtonBorderBrush}" />
Expand All @@ -195,11 +195,11 @@
<Setter.Value>
<ControlTemplate TargetType="AppBarButton">
<um:Ripple Feedback="{TemplateBinding Foreground}"
FeedbackOpacity="{StaticResource PressedOpacity}"
MinWidth="{TemplateBinding MinWidth}"
MaxWidth="{TemplateBinding MaxWidth}">
FeedbackOpacity="{StaticResource PressedOpacity}"
MinWidth="{TemplateBinding MinWidth}"
MaxWidth="{TemplateBinding MaxWidth}">
<Grid x:Name="Root"
Background="Transparent">
Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
Expand Down Expand Up @@ -228,14 +228,14 @@
</VisualStateManager.VisualStateGroups>

<Border x:Name="AppBarButtonInnerBorder"
Margin="{ThemeResource AppBarButtonInnerBorderMargin}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Control.IsTemplateFocusTarget="True" />
Margin="{ThemeResource AppBarButtonInnerBorderMargin}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Control.IsTemplateFocusTarget="True" />

<Grid x:Name="ContentRoot"
MinHeight="{ThemeResource AppBarThemeMinHeight}">
MinHeight="{ThemeResource AppBarThemeMinHeight}">

<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand All @@ -248,9 +248,9 @@
</Grid.RowDefinitions>

<PathIcon Data="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Grid>
</Grid>
</um:Ripple>
Expand Down

0 comments on commit 9f95f9e

Please sign in to comment.