This repository has been archived by the owner on May 1, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Button VisualState Disabled in UWP (#13148)
- Loading branch information
1 parent
f4a379f
commit b85c28e
Showing
4 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12984.xaml
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,69 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue12984" | ||
Title="Issue 12984"> | ||
<Grid RowDefinitions="Auto,*"> | ||
<Label | ||
Grid.Row="0" | ||
Padding="12" | ||
BackgroundColor="Black" | ||
TextColor="White" | ||
Text="If the background color of the disabled Button is pink, the test has passed."/> | ||
<StackLayout | ||
Grid.Row="1"> | ||
<Button | ||
Text="Normal Button"> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal"> | ||
<VisualState.Setters> | ||
<Setter Property="BackgroundColor" Value="Red" /> | ||
<Setter Property="BorderColor" Value="Yellow" /> | ||
<Setter Property="TextColor" Value="White" /> | ||
<Setter Property="FontSize" Value="Small" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="Selected"> | ||
<VisualState.Setters> | ||
<Setter Property="BackgroundColor" Value="Green" /> | ||
<Setter Property="BorderColor" Value="Orange" /> | ||
<Setter Property="TextColor" Value="Yellow" /> | ||
<Setter Property="FontSize" Value="Medium" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="Focused"> | ||
<VisualState.Setters> | ||
<Setter Property="BackgroundColor" Value="Blue" /> | ||
<Setter Property="BorderColor" Value="Purple" /> | ||
<Setter Property="TextColor" Value="Yellow" /> | ||
<Setter Property="FontSize" Value="Medium" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Button> | ||
<Button | ||
Text="Disabled Button" | ||
IsEnabled="False"> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Disabled"> | ||
<VisualState.Setters> | ||
<Setter Property="BackgroundColor" Value="Pink" /> | ||
<Setter Property="BorderColor" Value="Orange" /> | ||
<Setter Property="TextColor" Value="Red" /> | ||
<Setter Property="FontSize" Value="Micro" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Button> | ||
</StackLayout> | ||
</Grid> | ||
</controls:TestContentPage> |
32 changes: 32 additions & 0 deletions
32
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12984.xaml.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,32 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.CollectionView)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 12984, "[Bug][UWP] VisualState Disabled not working on Button", | ||
PlatformAffected.UWP)] | ||
public partial class Issue12984 : TestContentPage | ||
{ | ||
public Issue12984() | ||
{ | ||
#if APP | ||
InitializeComponent(); | ||
#endif | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
|
||
} | ||
} | ||
} |
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