Skip to content
Permalink
Browse files

Fix #1547: Fully qualify attached properties in styles.

  • Loading branch information...
siegfriedpammer committed Jun 14, 2019
1 parent 49586c7 commit d965e6aa9e47c88ef5d2fc67b54873226845fb73
@@ -521,9 +521,9 @@ public static IType GetElementTypeFromIEnumerable(this IType collectionType, ICo
return SpecialType.UnknownType;
}

public static bool FullNameIs(this IMethod method, string type, string name)
public static bool FullNameIs(this IMember member, string type, string name)
{
return method.Name == name && method.DeclaringType?.FullName == type;
return member.Name == name && member.DeclaringType?.FullName == type;
}

public static KnownAttribute IsBuiltinAttribute(this ITypeDefinition type)
@@ -113,6 +113,12 @@ public void Issue1546()
RunTest("cases/issue1546");
}

[Test]
public void Issue1547()
{
RunTest("cases/issue1547");
}

#region RunTest
void RunTest(string name)
{
@@ -35,8 +35,8 @@
</Border>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsMouseOver" Value="True">
<Setter TargetName="PaneHeaderCommandIntBorder" Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" />
<Setter TargetName="PaneHeaderCommandIntBorder" Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" />
<Setter TargetName="PaneHeaderCommandIntBorder" Property="Border.BorderBrush" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" />
<Setter TargetName="PaneHeaderCommandIntBorder" Property="Border.Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" />
<Setter TargetName="PaneHeaderCommandIntBorder" Property="UIElement.Opacity" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
@@ -0,0 +1,24 @@
<Window x:Class="ILSpy.BamlDecompiler.Tests.Cases.Issue1547" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ILSpy.BamlDecompiler.Tests.Cases" Title="Issue1547" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button>
<FrameworkElement.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Grid.Row" Value="1" />
<Setter Property="Content" Value="World!" />
</Style>
</FrameworkElement.Style>
</Button>
<Button>
<FrameworkElement.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Grid.Row" Value="0" />
<Setter Property="Content" Value="Hello" />
</Style>
</FrameworkElement.Style>
</Button>
</Grid>
</Window>
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ILSpy.BamlDecompiler.Tests.Cases
{
/// <summary>
/// Interaction logic for Issue1547.xaml
/// </summary>
public partial class Issue1547 : Window
{
public Issue1547()
{
InitializeComponent();
}
}
}
@@ -47,6 +47,7 @@
<DependentUpon>AttachedEvent.xaml</DependentUpon>
</Compile>
<Compile Include="Cases\CustomControl.cs" />
<Compile Include="Cases\Issue1547.xaml.cs" />
<Compile Include="Cases\MyControl.xaml.cs">
<DependentUpon>MyControl.xaml</DependentUpon>
</Compile>
@@ -77,6 +78,9 @@
<Page Include="Cases\Issue1546.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue1547.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Cases\Issue775.xaml">
<SubType>Designer</SubType>
</Page>

0 comments on commit d965e6a

Please sign in to comment.
You can’t perform that action at this time.