We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can i fix my viewmodel for changeable propertyname

Hi, this is my view model. So it is work for static property name.
for example;

  public class BankaBazliInfo
    {
        private string bankName;
        private double tryTotal;
        private double usdTotal;
        private double eurTotal;
        private double gbpTotal;
        private double chfTotal;
        private double cadTotal;

        public string BankName
        {
            get { return bankName; }
            set { this.bankName = value; }
        }

        public double TryTotal
        {
            get { return tryTotal; }
            set { this.tryTotal = value; }
        }

        public double UsdTotal
        {
            get { return usdTotal; }
            set { this.usdTotal = value; }
        }

        public double EurTotal
        {
            get { return this.eurTotal; }
            set { this.eurTotal = value; }
        }

        public double GbpTotal
        {
            get { return gbpTotal; }
            set { this.gbpTotal = value; }
        }
        public double ChfTotal
        {
            get { return chfTotal; }
            set { this.chfTotal = value; }
        }
        public double CadTotal
        {
            get { return cadTotal; }
            set { this.cadTotal = value; }
        }

        public BankaBazliInfo(string bankName, double tryTotal, double usdTotal, double eurTotal)
        {
            this.bankName = bankName;
            this.tryTotal = tryTotal;
            this.usdTotal = usdTotal;
            this.eurTotal = eurTotal;
        }
    }

Now, i want to change model like with dynamic properties. Beacaue i seted my viewmodel as six currency name, but it is changeable like 5 or 7 currency, maybe like Dictionary for example;

Dictionary<string, Dictionary<string, double>>() => Dictionary<BankName, Dictionary<CurrenyName, Total>>()

2 Replies

MN Mahmut Nedim December 9, 2019 08:17 AM UTC



FP Farjana Parveen Ayubb Syncfusion Team December 9, 2019 08:43 AM UTC

Hi Mahmut, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon