In WPF do DependencyProperty's cause lots of boxing/unboxing when used with value types?

Viewed 849

In WPF do DependencyProperty's cause lots of boxing/unboxing when used with value types? Or does the implementation some how to prevent this and not box/unbox value types? Is so how do they do this?

I think value types are a major use case for DependencyPropertys.

Thanks

    public double Price
    {
        get { return (double)GetValue(PriceProperty); }
        set { SetValue(PriceProperty, value); }
    }


    public static readonly DependencyProperty PriceProperty =
        DependencyProperty.Register("Price", typeof(double), typeof(Quote), new UIPropertyMetadata(0.0d));
3 Answers
Related