usefulBee
usefulBee

Reputation: 9692

Why a Custom Dependency Property is not Showing in User Control's intellisense?

I created a User Control and in code behind, I added the following DP. When I switch to XAML and try to type the name of the property next to the UserControl tag, for example "Test", it doesn't show up. I wonder what could be missing here.

    public static readonly DependencyProperty TestProperty =
        DependencyProperty.Register("Test", typeof(String), typeof(UserControl1));

Upvotes: 0

Views: 1771

Answers (1)

Clemens
Clemens

Reputation: 128061

You also need to implement the CLR Wrapper for that property:

public string Test
{
    get { return (string)GetValue(TestProperty); }
    set { SetValue(TestProperty, value); }
}

Upvotes: 3

Related Questions