Support for CommunityToolkit.Mvvm ObservableProperty in WPF PropertyGrid control

0 Answers 63 Views
PropertyGrid
Jian
Top achievements
Rank 1
Jian asked on 24 Jun 2024, 01:35 AM

I created a class with CommunityToolkit.Mvvm package and use ObservableProperty to create properties for this class. But the PropertyGrid  control does not recognize properties created in this way. Are there any way PropertyGrid  can support ObservableProperty?


using CommunityToolkit.Mvvm.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Test
{
    public partial class DrawingModel : ObservableObject
    {
        public string Name { get; set; }

        [ObservableProperty]
        public double _length;


        [ObservableProperty]
        public double _width;

        [ObservableProperty]
        public double _height;
    }
}

No answers yet. Maybe you can help?

Tags
PropertyGrid
Asked by
Jian
Top achievements
Rank 1
Share this question
or