forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigationbar BarBackgroundColor is not updating (dotnet#23195)
- Loading branch information
Showing
7 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23195.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#if IOS || ANDROID | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue23195 : _IssuesUITest | ||
{ | ||
public override string Issue => "NavigationBarColors from NavigationPage not changing on AppTheme changing"; | ||
|
||
public Issue23195(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
[Test] | ||
public void Issue23195Test() | ||
{ | ||
App.WaitForElement("button"); | ||
App.Click("button"); | ||
App.WaitForElement("label"); | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<NavigationPage | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Name="Self" | ||
BarBackgroundColor="{AppThemeBinding Light=White,Dark=Black}" | ||
BarTextColor="{AppThemeBinding Light=Black,Dark=White}" | ||
x:Class="Maui.Controls.Sample.Issues.Issue23195"> | ||
<x:Arguments> | ||
<ContentPage x:Name="contentPage" Title="Content page"> | ||
<ContentPage.ToolbarItems> | ||
<ToolbarItem> | ||
<ToolbarItem.IconImageSource> | ||
<FontImageSource Glyph="" | ||
Color="{AppThemeBinding Light=Black, Dark=White}" | ||
FontFamily="FA"/> | ||
</ToolbarItem.IconImageSource> | ||
</ToolbarItem> | ||
</ContentPage.ToolbarItems> | ||
<VerticalStackLayout> | ||
<Button Text="Chnage theme" | ||
AutomationId="button" | ||
HeightRequest="100" | ||
Clicked="Button_Clicked"/> | ||
<Label Text="Dark theme applied" | ||
IsVisible="{AppThemeBinding Default=False,Dark=True}" | ||
AutomationId="label"/> | ||
</VerticalStackLayout> | ||
</ContentPage> | ||
</x:Arguments> | ||
</NavigationPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 23195, "NavigationBarColors from NavigationPage not changing on AppTheme changing", PlatformAffected.Android | PlatformAffected.iOS)] | ||
public partial class Issue23195 : NavigationPage | ||
{ | ||
public Issue23195() | ||
{ | ||
InitializeComponent(); | ||
PushAsync(contentPage); | ||
} | ||
|
||
public void Button_Clicked(object sender, EventArgs eventArgs) | ||
{ | ||
Application.Current!.UserAppTheme= AppTheme.Dark; | ||
} | ||
} | ||
} |