Skip to content

DrawingExampleVM

闫驚鏵(Jinhua Yan) edited this page Apr 16, 2023 · 1 revision
 public class DrawingModel : ViewModelBase
    {
        private int _Index = 0;
        public int Index
        {
            get => _Index;
            set => SetProperty(ref _Index, value);
        }

        private string _Number = default;
        public string Number
        {
            get => _Number;
            set => SetProperty(ref _Number, value); 
        }


    }

    public class DrawingExampleVM : ViewModelBase
    {
        public DrawingExampleVM()
        {
            for (int i = 0; i < 10; ++i)
            {
                DrawingModel drawingModel = new DrawingModel()
                {
                    Index = i,
                    Number =$"仓{(i + 1).ToString()}" ,
                };

                Drawings.Add(drawingModel);
            }
        }


        public ObservableCollection<DrawingModel> Drawings { get; } = new ObservableCollection<DrawingModel>();



    }
Clone this wiki locally