I have a problem with read-only attached property. I defined it in this way :
public class AttachedPropertyHelper : DependencyObject
{
public static readonly DependencyPropertyKey SomethingPropertyKey = DependencyProperty.RegisterAttachedReadOnly("Something", typeof(int), typeof(AttachedPropertyHelper), new PropertyMetadata(0));
public static readonly DependencyProperty SomethingProperty = SomethingPropertyKey.DependencyProperty;
}
And I want to use it in XAML :
<Trigger Property="m:AttachedPropertyHelper.Something" Value="0">
<Setter Property="FontSize" Value="20"/>
</Trigger>
But compiler doesnt want to work with it. In result, I have 2 errors:
Cannot find the Style Property 'Something' on the type 'ReadonlyAttachedProperty.AttachedPropertyHelper'. Line 11 Position 16.
Property 'Something' was not found in type 'TextBlock'.