-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dependencyobject): Clear binding on ClearValue
- Loading branch information
1 parent
bb45d4d
commit 9b2f394
Showing
7 changed files
with
243 additions
and
0 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
41 changes: 41 additions & 0 deletions
41
...Tests/Windows_UI_Xaml/Controls/When_StaticResource_And_VisualState_Setter_ClearValue.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,41 @@ | ||
<UserControl x:Class="Uno.UI.Tests.Windows_UI_Xaml.Controls.When_StaticResource_And_VisualState_Setter_ClearValue" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.Tests.Windows_UI_Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
x:Name="OuterElementTopLevel" | ||
x:FieldModifier="public" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<Grid.Resources> | ||
<x:String x:Key="resource1">my static resource</x:String> | ||
</Grid.Resources> | ||
|
||
|
||
<ContentControl x:Name="topLevel" | ||
x:FieldModifier="public" | ||
Tag="Default Value"> | ||
<ContentControl.Template> | ||
<ControlTemplate TargetType="ContentControl"> | ||
<Grid> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="DefaultState" /> | ||
<VisualState x:Name="NewState"> | ||
<VisualState.Setters> | ||
<Setter Target="innerContent.Tag" Value="42" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
|
||
<ContentPresenter x:Name="innerContent" | ||
Content="{TemplateBinding Content}" | ||
Tag="{StaticResource resource1}" /> | ||
</Grid> | ||
</ControlTemplate> | ||
</ContentControl.Template> | ||
</ContentControl> | ||
</Grid> | ||
</UserControl> |
28 changes: 28 additions & 0 deletions
28
...ts/Windows_UI_Xaml/Controls/When_StaticResource_And_VisualState_Setter_ClearValue.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,28 @@ | ||
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.Markup; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace Uno.UI.Tests.Windows_UI_Xaml.Controls | ||
{ | ||
public sealed partial class When_StaticResource_And_VisualState_Setter_ClearValue : UserControl | ||
{ | ||
public When_StaticResource_And_VisualState_Setter_ClearValue() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ests/Windows_UI_Xaml/Controls/When_TemplateBinding_And_VisualState_Setter_ClearValue.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,34 @@ | ||
<UserControl x:Class="Uno.UI.Tests.Windows_UI_Xaml.Controls.When_TemplateBinding_And_VisualState_Setter_ClearValue" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.Tests.Windows_UI_Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
x:Name="OuterElementTopLevel" | ||
x:FieldModifier="public" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<ContentControl x:Name="topLevel" | ||
x:FieldModifier="public" | ||
Tag="Default Value"> | ||
<ContentControl.Template> | ||
<ControlTemplate TargetType="ContentControl"> | ||
<Grid> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="DefaultState" /> | ||
<VisualState x:Name="NewState"> | ||
<VisualState.Setters> | ||
<Setter Target="innerContent.Tag" Value="42" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
|
||
<ContentPresenter x:Name="innerContent" Content="{TemplateBinding Content}" Tag="{TemplateBinding Tag}" /> | ||
</Grid> | ||
</ControlTemplate> | ||
</ContentControl.Template> | ||
</ContentControl> | ||
</Grid> | ||
</UserControl> |
28 changes: 28 additions & 0 deletions
28
...s/Windows_UI_Xaml/Controls/When_TemplateBinding_And_VisualState_Setter_ClearValue.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,28 @@ | ||
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.Markup; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace Uno.UI.Tests.Windows_UI_Xaml.Controls | ||
{ | ||
public sealed partial class When_TemplateBinding_And_VisualState_Setter_ClearValue : UserControl | ||
{ | ||
public When_TemplateBinding_And_VisualState_Setter_ClearValue() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
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