Example #1
0
        /// <summary>
        ///     Calls the deserialize method to initialize the weightlist.
        /// </summary>
        /// <returns></returns>
        private async Task InitializeModel()
        {
            Debug.WriteLine("USER DEBUG: Initializing model");

            weights = new WeightModel();
            try
            {
                await weights.deserializeJsonAsync();
            }
            catch (FileNotFoundException e)
            {
                ToastPrompt toast = new ToastPrompt();
                toast.Title   = "Easy Weight";
                toast.Message = "No file to load. ";
                toast.MillisecondsUntilHidden = 2000;
                toast.ImageSource             = new BitmapImage(new Uri("ApplicationIcon.png", UriKind.RelativeOrAbsolute));

                toast.Show();
            }

            Debug.WriteLine("USER DEBUG: Model initialized");
        }