Browse Source

Additional testing for attached properties.

pull/404/head
Vaughan Woodzell 12 years ago
parent
commit
53cf2a6307
  1. 14
      ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs
  2. 14
      ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml

14
ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs

@ -3,11 +3,23 @@ using System.Collections.Generic; @@ -3,11 +3,23 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace ILSpy.BamlDecompiler.Tests.Cases
{
public class CustomControl : Control
public class CustomControl : ContentControl
{
public static readonly DependencyProperty CustomNameProperty = DependencyProperty.RegisterAttached("CustomName", typeof(string), typeof(CustomControl));
public static string GetCustomName(DependencyObject target)
{
return (string)target.GetValue(CustomNameProperty);
}
public static void SetCustomName(DependencyObject target, string value)
{
target.SetValue(CustomNameProperty, value);
}
}
}

14
ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml

@ -1,12 +1,16 @@ @@ -1,12 +1,16 @@
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:cc="clr-namespace:ILSpy.BamlDecompiler.Tests.Cases">
<Label>
<Label.Style>
<Style />
</Label.Style>
</Label>
<cc:CustomControl>
<cc:CustomControl.Style>
<Style />
</cc:CustomControl.Style>
<Grid.Row>0</Grid.Row>
<cc:CustomControl.CustomName>Custom1</cc:CustomControl.CustomName>
</cc:CustomControl>
<Label>
<Label.Style>
<Style />
</Label.Style>
<Grid.Row>0</Grid.Row>
<cc:CustomControl.CustomName>Label1</cc:CustomControl.CustomName>
</Label>
</Grid>
Loading…
Cancel
Save