Skip to content

Application freeze when declaring DP in class with generic #10

@RodgerLeblanc

Description

@RodgerLeblanc

When declaring a DP using Bindables in a generic class, the application freezes.

namespace BindablesGeneric
{
    public class MyLabel : MyLabel<string>
    {
    }

    public class MyLabel<T> : Label
    {
        //This one hang the execution, need to force close Visual Studio

        [DependencyProperty]
        public object MyProperty { get; set; }



        //This one works

        //public static readonly DependencyProperty MyPropertyProperty =
        //    DependencyProperty.Register(nameof(MyProperty), typeof(object), typeof(MyLabel<T>), new PropertyMetadata(null));

        //public object MyProperty
        //{
        //    get { return (object)GetValue(MyPropertyProperty); }
        //    set { SetValue(MyPropertyProperty, value); }
        //}
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions