我有一类附加属性:附加属性为XAML元素
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);
}
}
而且我用我的XAML这些属性:
<Border me:XamlProps.Foo="Foo to the Bar">
但现在我想在这个更大的值财产,所以我想用它作为一个元素:
<Border>
<me:XamlProps.Foo>Foo to the Bar</me:XamlProps.Foo>
</Border>
但现在Silverlight不叫SetFoo()了。我如何得到这个工作?
在Windows Phone 7上,如果它很重要。
这工作就像一个魅力。非常感谢 – Hounshell 2011-03-11 18:35:40
有没有办法将其包装在? – Hounshell 2011-03-11 18:51:23
似乎并不是:http://stackoverflow.com/questions/4048223/silverlight-xaml-textblock-text-with-cdata-not-showing-up-at-runtime – Damian 2011-03-11 19:51:09