Могу ли я использовать привязки с расширениями разметки SL5 RC?
Вот мой XAML:
...
<TextBlock>
<TextBlock.Text>
<local:LengtherMarkupExtension Test="{Binding ElementName='MyTextBox', Path='Text'}" />
</TextBlock.Text>
</TextBlock>
...
И МЕ:
public class LengtherMarkupExtension: FrameworkElement,
IMarkupExtension<string>
{
public LengtherMarkupExtension()
{
//this.DataContext = this;
}
public static readonly DependencyProperty TestProperty =
DependencyProperty.Register("Test",
typeof(string),
typeof(LengtherMarkupExtension),
new PropertyMetadata("DefaultValue",
(o, e) =>
{
System.Diagnostics.Debugger.Break();
}));
public string Test
{
get { return (string)this.GetValue(LengtherMarkupExtension.TestProperty); }
set { this.SetValue(LengtherMarkupExtension.TestProperty, value); }
}
public string ProvideValue(IServiceProvider serviceProvider)
{
return this.Test.Length.ToString();
}
}
Тестовое свойство моего ME не устанавливается через привязку, несмотря ни на что, я делаю что-то не так?