This project is read-only.

using Roaming;
namespace App1
{
    /// <summary>
    /// Class Favorite
    /// </summary>
    public class Favorite : RoamingObservableDictionary
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Favorite"/> class.
        /// </summary>
        public Favorite()
        {

        }
        /// <summary>
        /// Gets or sets the URL.
        /// </summary>
        /// <value>The URL.</value>
        public string Url { get { return Get("Url"); } set { Set("Url", value); } }
        /// <summary>
        /// Gets or sets the Body.
        /// </summary>
        /// <value>The body.</value>
        public string Body { get { return Get("Body"); } set { Set("Body", value); } }
    }

    /// <summary>
    /// Class MyViewModel
    /// </summary>
    public class MyViewModel : ObservableDictionary<string, object>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MyViewModel"/> class.
        /// </summary>
        public MyViewModel()
        {
            Favorites = new RoamingObservableCollection<Favorite>();
            Favorites.Container = ApplicationData.Current.RoamingSettings.CreateContainer("Favorites", ApplicationDataCreateDisposition.Always);
            NewPage = new Favorite();
            NewPage.Container = ApplicationData.Current.RoamingSettings.CreateContainer("NewPage", ApplicationDataCreateDisposition.Always);
        }
        /// <summary>
        /// Gets or sets the new page.
        /// </summary>
        /// <value>The new page.</value>
        public Favorite NewPage
        {
            get
            {
                return (Favorite)this["NewPage"];
            }
            set
            {
                this["NewPage"] = value;
            }
        }

        /// <summary>
        /// Gets the favorites.
        /// </summary>
        /// <value>The favorites.</value>
        public RoamingObservableCollection<Favorite> Favorites
        {
            get
            {
                return (RoamingObservableCollection<Favorite>)this["Favorites"];
            }
            private set
            {
                this["Favorites"] = value;
            }
        }
    }


}

Last edited Aug 2, 2013 at 3:54 PM by fenixbrood, version 4

Comments

No comments yet.