I’ve got a class of attached properties:
public static class XamlProps
{
#region Attached Properties
private static readonly DependencyProperty FooProperty = DependencyProperty.RegisterAttached(
"Foo",
typeof(string),
typeof(XamlProps),
null);
public static void SetFoo(DependencyObject obj, string action)
{
obj.SetValue(FooProperty, action);
}
}
And I use these properties in my XAML:
<Border me:XamlProps.Foo="Foo to the Bar">
But now I want a larger value in this property, so I’d like to use it as an element:
<Border>
<me:XamlProps.Foo>Foo to the Bar</me:XamlProps.Foo>
</Border>
But now Silverlight doesn’t call SetFoo() anymore. How do I get this to work?
On Windows Phone 7 if it matters.
You’ll need to specify the type if you use that syntax:
Where the sys namespace maps to System. You also need to define GetFoo …
Probably a copy-paste typo, but in the registration
should be