/// <summary>
        /// Preserves state associated with this page in case the application is suspended or the
        /// page is discarded from the navigation cache.  Values must conform to the serialization
        /// requirements of <see cref="SuspensionManager.SessionState"/>.
        /// </summary>
        /// <param name="pageState">An empty dictionary to be populated with serializable state.</param>
        protected async override void SaveState(Dictionary <String, Object> pageState)
        {
            var mc = new MenuCard
            {
                Title       = info.Title,
                Description = info.Description,
                Image       = info.Image,
                ImagePath   = info.ImageFileName
            };

            mc.SetDirty();
            MenuCardFactory.Instance.Cards.Add(mc);

            var storage = new MenuCardStorage();
            await storage.WriteMenuCardsAsync(MenuCardFactory.Instance.Cards.ToList());
        }
示例#2
0
 private void SetDirty()
 {
     MenuCard?.SetDirty();
 }