-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13016 from unoplatform/dev/mazi/style-setters-the…
…ming fix: `ThemeResource` bindings are not scope-updated on `Style` switch
- Loading branch information
Showing
4 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
....UI.RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_ThemeResource_Style_Switch_Page.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,28 @@ | ||
<UserControl x:Class="Uno.UI.RuntimeTests.When_ThemeResource_Style_Switch_Page" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<UserControl.Resources> | ||
<Style x:Key="FirstButtonStyle" TargetType="Button"> | ||
<Setter Property="Background" Value="{ThemeResource ButtonBackground}" /> | ||
</Style> | ||
<Style x:Key="SecondButtonStyle" TargetType="Button"> | ||
<Setter Property="Background" Value="{ThemeResource ButtonBackgroundPressed}" /> | ||
</Style> | ||
</UserControl.Resources> | ||
<StackPanel> | ||
<Border> | ||
<Border.Resources> | ||
<SolidColorBrush x:Key="ButtonBackground" Color="Blue" /> | ||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="Red" /> | ||
</Border.Resources> | ||
<Button x:Name="TestBtn" Style="{StaticResource FirstButtonStyle}" Width="100" Height="100" /> | ||
</Border> | ||
</StackPanel> | ||
</UserControl> |
26 changes: 26 additions & 0 deletions
26
....RuntimeTests/Tests/Windows_UI_Xaml/Controls/When_ThemeResource_Style_Switch_Page.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,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace Uno.UI.RuntimeTests; | ||
|
||
public sealed partial class When_ThemeResource_Style_Switch_Page : UserControl | ||
{ | ||
public When_ThemeResource_Style_Switch_Page() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
public Button TestButton => TestBtn; | ||
} |
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