using LogoForceTestApp.Modules.MainModule.Method;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LogoForceTestApp.Modules.MainModule.Models
{
    public class MulProductModel : BindableBase
    {
        private ObservableCollection<ProductModel> _ProductCollection;
        public ObservableCollection<ProductModel> ProductCollection
        {
            get { return _ProductCollection; }
            set { SetProperty(ref _ProductCollection, value); }
        }

        public MulProductModel()
        {
            ProductCollection = new ObservableCollection<ProductModel>();
        }

        public void SaveParame()
        {
            DataHelp.WriteJsonFile(this, GVariable.ProductsConfig);
        }

        public void LoadParame()
        {
            var res= DataHelp.ReadJsonFile<MulProductModel>(GVariable.ProductsConfig);
            this.ProductCollection = res.ProductCollection;
        }
    }
}