public void setControlValues(ref Team team, ref TeamGridViewModel r)
        {
            PreferencesSettings           curSettings          = settings.curPreferencesSettings;
            ObservableCollection <String> ProfileGenericLabels = globalFuncs.localization.ProfileGenericLabels;

            this.ID   = r.ID;
            this.name = team.Club.Name;

            this.SelectionButton.Content = this.name;

            string isNational = ProfileGenericLabels[ScoutLocalization.PG_NO];

            if (globalFuncs.localization.regionsNative.Contains(team.Club.Country.Name))
            {
                isNational = ProfileGenericLabels[ScoutLocalization.PG_YES];
            }

            this.buttonlistplayerscontent   = ProfileGenericLabels[ScoutLocalization.PG_LISTPLAYERS];
            this.buttonliststaffcontent     = ProfileGenericLabels[ScoutLocalization.PG_LISTSTAFF];
            this.buttonhealteamcontent      = ProfileGenericLabels[ScoutLocalization.PG_HEALTEAM];
            this.buttonhealteamisenabled    = false;
            this.combolistplayersitems      = this.combolistplayersitemsList;
            this.combolistplayersisenabled  = true;
            this.buttonliststaffisenabled   = true;
            this.buttonlistplayersisenabled = true;

            if (isNational.Equals(ProfileGenericLabels[ScoutLocalization.PG_NO]))
            {
                this.combolistplayersitemsList.Add(ProfileGenericLabels[ScoutLocalization.PG_ALLSQUADS]);
                for (int i = 0; i < team.Club.Teams.Count; ++i)
                {
                    if (team.Club.Teams[i].Type != TeamTypeEnum.Empty)
                    {
                        this.combolistplayersitemsList.Add(team.Club.Teams[i].Type.ToString() + " " + ProfileGenericLabels[ScoutLocalization.PG_TEAM]);
                    }
                }

                if (this.combolistplayersitemsList.Count > 1)
                {
                    if (this.combolistplayersitemsList.Count == 2)
                    {
                        this.combolistplayersitemsList.RemoveAt(0);
                        this.combolistplayersisenabled = false;
                    }
                    this.combolistplayersselecteditem = this.combolistplayersitemsList[0];
                }
            }
            else
            {
                this.buttonlistplayersisenabled = false;
                this.combolistplayersitemsList.Add(ProfileGenericLabels[ScoutLocalization.PG_NATIONPLAYERS]);
            }
            this.combolistplayersselecteditem = this.combolistplayersitemsList[0];

            if (settings.curPreferencesSettings.editing.Equals(ProfileGenericLabels[ScoutLocalization.PG_YES]))
            {
                if (this.combolistplayersitemsList.Count > 1 && isNational.Equals(ProfileGenericLabels[ScoutLocalization.PG_NO]))
                {
                    this.buttonhealteamisenabled = true;
                }
            }

            if (isNational.Equals(ProfileGenericLabels[ScoutLocalization.PG_NO]))
            {
                this.nation  = team.Club.Country.Name;
                this.nation += " (" + team.Club.Country.Continent.Name + ")";
                this.yearfounded.TextBoxText       = team.Club.YearFounded.ToString();
                this.maxattendance.TextBoxText     = team.Club.MaximumAttendance.ToString();
                this.averageattendance.TextBoxText = team.Club.AverageAttendance.ToString();
                this.minattendance.TextBoxText     = team.Club.MinimumAttendance.ToString();

                this.totaltransfer.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_NOBUDGET];
                this.remtransfer.TextBoxText   = ProfileGenericLabels[ScoutLocalization.PG_NOBUDGET];
                this.totalwage.TextBoxText     = ProfileGenericLabels[ScoutLocalization.PG_NOBUDGET];
                this.usedwage.TextBoxText      = ProfileGenericLabels[ScoutLocalization.PG_NOBUDGET];

                // finance details
                if (team.Club.Finances.RemainingTransferBudget != 29476012)
                {
                    this.totaltransfer.TextBoxText = (team.Club.Finances.SeasonTransferBudget * curSettings.currencyMultiplier.multiplier).ToString("C0", curSettings.currencyMultiplier.format);
                    this.remtransfer.TextBoxText   = (team.Club.Finances.RemainingTransferBudget * curSettings.currencyMultiplier.multiplier).ToString("C0", curSettings.currencyMultiplier.format);
                    this.totalwage.TextBoxText     = (team.Club.Finances.WageBudget * curSettings.currencyMultiplier.multiplier).ToString("C0", curSettings.currencyMultiplier.format);
                    this.usedwage.TextBoxText      = (team.Club.Finances.UsedWage * curSettings.currencyMultiplier.multiplier).ToString("C0", curSettings.currencyMultiplier.format);
                }

                this.balance.TextBoxText = (team.Club.Finances.Balance * curSettings.currencyMultiplier.multiplier).ToString("C0", curSettings.currencyMultiplier.format);

                if (team.Club.Finances.TransferRevenueMadeAvailable != 0)
                {
                    this.revenueavailable.TextBoxText = (team.Club.Finances.TransferRevenueMadeAvailable * 0.01f).ToString("P0");
                }
                else
                {
                    this.revenueavailable.TextBoxText = "0%";
                }

                // stadium details
                this.stadiumname = team.Stadium.ToString();
                if (team.Stadium.Owner != null)
                {
                    this.stadiumowner = team.Stadium.Owner.Name.ToString();
                }
                else
                {
                    this.stadiumowner = ProfileGenericLabels[ScoutLocalization.PG_NOOWNER];
                }
                this.stadiumlocation = team.Stadium.City.Name.ToString();
                if (team.Stadium.NearbyStadium != null)
                {
                    this.stadiumnearby = team.Stadium.NearbyStadium.Name;
                }
                else
                {
                    this.stadiumnearby = ProfileGenericLabels[ScoutLocalization.PG_NONEARBYSTADIUM];
                }
                this.decay.TextBoxText        = team.Stadium.Decay.ToString();
                this.fieldwidth.TextBoxText   = (float.Parse(team.Stadium.FieldWidth.ToString())).ToString() + "m";
                this.fieldlength.TextBoxText  = (float.Parse(team.Stadium.FieldLength.ToString())).ToString() + "m";
                this.curcapacity.TextBoxText  = team.Stadium.StadiumCapacity.ToString();
                this.seatcapacity.TextBoxText = team.Stadium.SeatingCapacity.ToString();
                this.expcapacity.TextBoxText  = team.Stadium.ExpansionCapacity.ToString();
                this.usedcapacity.TextBoxText = team.Stadium.UsedCapacity.ToString();
            }
            else
            {
                this.nation = team.Club.Country.Name;
                this.yearfounded.TextBoxText       = ProfileGenericLabels[ScoutLocalization.PG_NONE];
                this.maxattendance.TextBoxText     = ProfileGenericLabels[ScoutLocalization.PG_NONE];
                this.averageattendance.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_NONE];
                this.minattendance.TextBoxText     = ProfileGenericLabels[ScoutLocalization.PG_NONE];

                this.totaltransfer.TextBoxText    = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.remtransfer.TextBoxText      = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.balance.TextBoxText          = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.totalwage.TextBoxText        = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.usedwage.TextBoxText         = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.revenueavailable.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];

                this.stadiumname              = ProfileGenericLabels[ScoutLocalization.PG_NONE];
                this.stadiumowner             = ProfileGenericLabels[ScoutLocalization.PG_NOOWNER];
                this.stadiumlocation          = ProfileGenericLabels[ScoutLocalization.PG_NOLOCATION];
                this.stadiumnearby            = ProfileGenericLabels[ScoutLocalization.PG_NONEARBYSTADIUM];
                this.decay.TextBoxText        = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];;
                this.fieldwidth.TextBoxText   = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.fieldlength.TextBoxText  = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.curcapacity.TextBoxText  = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.seatcapacity.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.expcapacity.TextBoxText  = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
                this.usedcapacity.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
            }

            this.national.TextBoxText           = isNational;
            this.status.TextBoxText             = team.Club.Status.ToString();
            this.maxafclubs.TextBoxText         = team.Club.MaxAffiliatedClubNumber.ToString();
            this.afclubs.TextBoxText            = team.Club.NumberOfAffiliatedClubs.ToString();
            this.trainingfacilities.TextBoxText = team.Club.TrainingFacilities.ToString();
            this.youthfacilities.TextBoxText    = team.Club.YouthFacilities.ToString();
            if (team.Club.YouthAcademy == 0)
            {
                this.youthacademy.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_NO];
            }
            else if (team.Club.YouthAcademy == 1)
            {
                this.youthacademy.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_YES];
            }
            else
            {
                this.youthacademy.TextBoxText = ProfileGenericLabels[ScoutLocalization.PG_UNAVAILABLE];
            }
            this.reputation.TextBoxText = team.Reputation.ToString();
        }
        public void setProfileViewModel(ref Team team, ref TeamGridViewModel r)
        {
            settings    = GlobalSettings.getSettings();
            context     = ScoutContext.getScoutContext();
            globalFuncs = Globals.getGlobalFuncs();

            this.SelectionButton           = new CheckBoxContext();
            this.SelectionButton.IsChecked = true;

            yearfounded        = new LabeledTextBoxContext();
            national           = new LabeledTextBoxContext();
            status             = new LabeledTextBoxContext();
            maxafclubs         = new LabeledTextBoxContext();
            afclubs            = new LabeledTextBoxContext();
            trainingfacilities = new LabeledTextBoxContext();
            youthfacilities    = new LabeledTextBoxContext();
            youthacademy       = new LabeledTextBoxContext();
            maxattendance      = new LabeledTextBoxContext();
            averageattendance  = new LabeledTextBoxContext();
            minattendance      = new LabeledTextBoxContext();
            reputation         = new LabeledTextBoxContext();

            totaltransfer    = new LabeledTextBoxContext();
            remtransfer      = new LabeledTextBoxContext();
            balance          = new LabeledTextBoxContext();
            totalwage        = new LabeledTextBoxContext();
            usedwage         = new LabeledTextBoxContext();
            revenueavailable = new LabeledTextBoxContext();

            decay        = new LabeledTextBoxContext();
            fieldwidth   = new LabeledTextBoxContext();
            fieldlength  = new LabeledTextBoxContext();
            curcapacity  = new LabeledTextBoxContext();
            seatcapacity = new LabeledTextBoxContext();
            expcapacity  = new LabeledTextBoxContext();
            usedcapacity = new LabeledTextBoxContext();

            this.generaldetails = new LabeledHeaderContext();
            this.financedetails = new LabeledHeaderContext();
            this.stadiumdetails = new LabeledHeaderContext();

            setProfileContext(yearfounded);
            setProfileContext(national);
            setProfileContext(status);
            setProfileContext(maxafclubs);
            setProfileContext(afclubs);
            setProfileContext(trainingfacilities);
            setProfileContext(youthfacilities);
            setProfileContext(youthacademy);
            setProfileContext(maxattendance);
            setProfileContext(averageattendance);
            setProfileContext(minattendance);
            setProfileContext(reputation);

            setProfileContext2(totaltransfer);
            setProfileContext2(remtransfer);
            setProfileContext2(balance);
            setProfileContext2(totalwage);
            setProfileContext2(usedwage);
            setProfileContext2(revenueavailable);

            setProfileContext3(decay);
            setProfileContext3(fieldwidth);
            setProfileContext3(fieldlength);
            setProfileContext3(curcapacity);
            setProfileContext3(seatcapacity);
            setProfileContext3(expcapacity);
            setProfileContext3(usedcapacity);

            setControlValues(ref team, ref r);
            setLocalization();
        }