Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AppBarButton inside NavigationBar keeps rendering on every click #1302

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</Grid.RowDefinitions>
<utu:NavigationBar Content="First Page"
MainCommandMode="Action"
AutomationProperties.AutomationId="FluentPage1NavBar"
Style="{StaticResource DefaultNavigationBar}">
<utu:NavigationBar.MainCommand>
<AppBarButton Click="NavigateBack"
Expand All @@ -42,6 +43,11 @@
<BitmapIcon UriSource="ms-appx:///Assets/AppleIcon_Small.png" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Click="NavigateToNextPage"
Label="Page2"
AutomationProperties.AutomationId="FluentPage1NavBarPrimaryCommand3"
Style="{StaticResource DefaultAppBarButtonStyle}"
Icon="Favorite" />
</utu:NavigationBar.PrimaryCommands>
<utu:NavigationBar.SecondaryCommands>
<AppBarButton Command="{Binding Secondary1CountCommand}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<utu:NavigationBar Content="Second Page"
AutomationProperties.AutomationId="FluentPage2NavBar"
Style="{StaticResource DefaultNavigationBar}">
<utu:NavigationBar.PrimaryCommands>
<AppBarButton Label="More"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ protected override IEnumerable<IDisposable> Initialize()
new[] { AppBarButton.LabelProperty },
new[] { AppBarButton.IconProperty },
new[] { AppBarButton.IconProperty, BitmapIcon.UriSourceProperty },
new[] { AppBarButton.IconProperty, IconElement.ForegroundProperty },
new[] { AppBarButton.IconProperty, IconElement.ForegroundProperty, SolidColorBrush.ColorProperty },
new[] { AppBarButton.ContentProperty },
new[] { AppBarButton.ContentProperty, FrameworkElement.VisibilityProperty },
new[] { AppBarButton.OpacityProperty },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,19 @@ public void NavBar_Page_Can_Go_Back()

App.WaitForNoElement("M3Page2NavBar", "Timed out waiting for no Page 2 Nav Bar");
}

[Test]
[AutoRetry]
public void NavBar_AppBarButton_With_Icon_Click()
{
NavigateToNestedSample("FluentNavigationBarSampleNestedPage");

PlatformHelpers.On(
iOS: () => App.Tap("FluentPage1NavBarPrimaryCommand3"),
Android: () => App.Tap("FluentPage1NavBarPrimaryCommand3")
);

App.WaitForElement("FluentPage2NavBar", "Timed out waiting for Page 2 Nav Bar");
}
}
}
Loading