我有一类附加属性:
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); } }@H_502_3@我在XAML中使用这些属性:
<Border me:XamlProps.Foo="Foo to the Bar">@H_502_3@但现在我想在这个属性中有一个更大的值,所以我想用它作为一个元素:
<Border> <me:XamlProps.Foo>Foo to the Bar</me:XamlProps.Foo> </Border>@H_502_3@但现在Silverlight不再调用SetFoo()了.我该如何让这个工作?
在Windows Phone 7上,如果重要.