예제 #1
0
        /// <summary>
        /// Called after the GetPersonas method, takes the persona objects and puts them into a PersonaContainer object that holds 2 persona
        /// objects then adds this container object to the pairedPersonas list. This is necessary in order to display the personas in a
        /// 2 column list.
        /// </summary>
        /// <return>None</return>
        private async void updatePairedPersonas()
        {
            try
            {
                pairedPersonas.Clear();
                await userPersonas.PopulatePersonasFromBackend().ConfigureAwait(true);

                personas = userPersonas.GetAllPersonas();

                for (int i = 0; i < personas.Count; i += 2)
                {
                    if (i + 1 < personas.Count)
                    {
                        this.pairedPersonas.Add(new PersonaContainer(personas[i], personas[i + 1]));
                    }
                    else
                    {
                        this.pairedPersonas.Add(new PersonaContainer(personas[i]));
                    }
                }
            }
            catch (BadBackendRequestException e)
            {
                errorHandler(e);
            }
        }
예제 #2
0
        public SettingsViewModel()
        {
            userPersonas = UserPersonas.GetInstance();
            personas     = userPersonas.GetAllPersonas();
            if (App.algorithm == "sar")
            {
                sarCheck  = "True";
                lgbmCheck = "False";
            }
            else
            {
                sarCheck  = "False";
                lgbmCheck = "True";
            }

            OpenGitHubLink = new Command(OpenGitHub);
        }
예제 #3
0
        void PersonaButtonClicked(object sender, EventArgs e)
        {
            var button = (ImageButton)sender;

            foreach (PersonaWrapper persona in personas.GetAllPersonas())
            {
                if (button.ClassId.Equals(persona.persona.Name, StringComparison.Ordinal))
                {
                    persona.ShowCheckmark = "True";
                }
                else
                {
                    persona.ShowCheckmark = "False";
                }
            }

            preferences.ClearPreferences();
            preferences.AddMultiplePreferences((List <Movie>)((PersonaWrapper)button.BindingContext).persona.getLikedMovies());
        }