Ejemplo n.º 1
0
        public async Task<bool> PinCategoryTile(Category category)
        {
            string tileId = category.ID.ToString();

            string arguements = tileId + "/" + "Category";

            string displayName = category.CategoryName;

            bool isPinned = false;

            if (!SecondaryTile.Exists(tileId))
            {
                var secondaryTile = new SecondaryTile();

                secondaryTile.TileId = tileId;

                secondaryTile.ShortName = "2nd tile";

                secondaryTile.DisplayName = displayName;

                secondaryTile.Arguments = arguements;

                secondaryTile.Logo = new Uri("ms-appdata:///local/картинка031.jpg");

                isPinned = await secondaryTile.RequestCreateAsync();

                return isPinned;
            }

            return isPinned;
        }
Ejemplo n.º 2
0
        private async Task AddNewCategory()
        {
            if (string.IsNullOrEmpty(this.NewCategoryString))
            {
                this.IsFlyoutOpen = true;

                return;
            }

            var newCategory = new Category(this.NewCategoryString);

            this.Categories.Add(newCategory);

            await SerializationProvider.Instance.SerializeCategories(this.Categories);

            this.NewCategoryString = string.Empty;

            this.IsFlyoutOpen = false;
        }