Skip to content
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 @@ -416,8 +416,7 @@ protected virtual async void UpdateLeftBarButtonItem(Context context, AToolbar t
var command = backButtonHandler.GetPropertyIfSet<ICommand>(BackButtonBehavior.CommandProperty, null);
var backButtonVisibleFromBehavior = backButtonHandler.GetPropertyIfSet(BackButtonBehavior.IsVisibleProperty, true);
bool isEnabled = _shell.Toolbar.BackButtonEnabled;
//Add the FlyoutIcon only if the FlyoutBehavior is Flyout
var image = _flyoutBehavior == FlyoutBehavior.Flyout ? GetFlyoutIcon(backButtonHandler, page) : null;
var image = _flyoutBehavior == FlyoutBehavior.Flyout ? GetFlyoutIcon(backButtonHandler, page) : backButtonHandler.GetPropertyIfSet<ImageSource>(BackButtonBehavior.IconOverrideProperty, null);
var backButtonVisible = _toolbar.BackButtonVisible;

DrawerArrowDrawable icon = null;
Expand Down
16 changes: 16 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32050.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue32050">

<ShellContent Title="Home">
<ContentPage>
<Label
Text="Issue 32050"
AutomationId="Label"
VerticalOptions="Center"
HorizontalOptions="Center"/>
</ContentPage>
</ShellContent>

</Shell>
21 changes: 21 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32050.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 32050, "IconOverride in Shell.BackButtonBehavior does not work.", PlatformAffected.iOS)]
public partial class Issue32050 : Shell
{
public Issue32050()
{
InitializeComponent();
Routing.RegisterRoute("Issue32050SubPage", typeof(Issue32050SubPage));
GoToAsync("Issue32050SubPage");
}

class Issue32050SubPage : ContentPage
{
public Issue32050SubPage()
{
Content = new Label { Text = "Label", AutomationId = "Label" };
SetBackButtonBehavior(this, new BackButtonBehavior { IconOverride = "coffee.png" });
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue32050 : _IssuesUITest
{
public Issue32050(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "IconOverride in Shell.BackButtonBehavior does not work.";

[Test]
[Category(UITestCategories.TitleView)]
public void IconOverrideInShellBackButtonBehaviorShouldWork()
{
App.WaitForElement("Label");
VerifyScreenshot();
}
}
Loading