public CategoryPostDS(Category cateogry)
        {
            // check category 
            if (cateogry == null)
            {
                throw new ArgumentNullException("category");
            }

            if (!Uri.IsWellFormedUriString(cateogry.Href, UriKind.RelativeOrAbsolute))
            {
                throw new ArgumentException("href of category");
            }

            this.Category = cateogry;
        }
        /// <summary>
        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        /// <para>
        /// Page specific logic should be placed in event handlers for the  
        /// <see cref="NavigationHelper.LoadState"/>
        /// and <see cref="NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method 
        /// in addition to page state preserved during an earlier session.
        /// </para>
        /// </summary>
        /// <param name="e">Provides data for navigation methods and event
        /// handlers that cannot cancel the navigation request.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.New)
            {
                Logger.LogAgent.GetInstance().WriteLog(this.GetType().ToString());
            }

            this.navigationHelper.OnNavigatedTo(e);
            this.category = e.Parameter as Category;
            this.LoadData();
        }
Beispiel #3
0
        private static async Task<StorageFile> GetFollowedCategoryFileAsync(Category category)
        {
            if (category != null)
            {
                var roamingFolder = Windows.Storage.ApplicationData.Current.RoamingFolder;

                var destFolder = await roamingFolder.CreateFolderAsync(FOLLOW_CATEGORY_FOLDER, Windows.Storage.CreationCollisionOption.OpenIfExists);

                var destFile = await destFolder.CreateFileAsync(category.Id + ".xml", Windows.Storage.CreationCollisionOption.ReplaceExisting);

                return destFile;
            }
            else
            {
                return null;
            }
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     navigationHelper.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New)
     {
         Logger.LogAgent.GetInstance().WriteLog(this.GetType().ToString());
     }
     this.category = e.Parameter as Category;
     //change the topic
     this.TitleControl.Text = loader.GetString("CategoryTitleText") + " - " + category.Name;
     this.LoadData();
 }