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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can i fix my viewmodel for changeable propertyname

Thread ID:

Created:

Updated:

Platform:

Replies:

149735 Dec 6,2019 09:37 PM UTC Dec 9,2019 08:43 AM UTC Xamarin.Forms 2
loading
Tags: SfDataGrid
Mahmut Nedim
Asked On December 6, 2019 09:37 PM UTC

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>>()

Mahmut Nedim
Replied On December 9, 2019 08:17 AM UTC


Farjana Parveen Ayubb [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon