Skip to content

Commit

Permalink
Additional testing for attached properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
vwoodzell committed May 16, 2013
1 parent b54be39 commit 53cf2a6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 13 additions & 1 deletion ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
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 changes: 9 additions & 5 deletions ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 53cf2a6

Please sign in to comment.