Esempio n. 1
0
        //Checks for the Navigation Parameter and changes the ViewModel to the requested Website.
        private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            Result = RenameResult.Nothing;
            long iD = Convert.ToInt64(sender.AccessKey);

            try
            {
                Website = WebsiteViewModel.FromWebsite(WebsiteDataSource.GetWebsite(iD));
            }
            catch
            {
                Website = WebsiteViewModel.FromWebsite(WebsiteDataSource.GetDefault());
            }
        }
        //Checks for the Navigation Parameter and changes the WebView.Source to the requested Website.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            long iD;

            try
            {
                iD      = Convert.ToInt64(e.Parameter);
                Website = WebsiteViewModel.FromWebsite(WebsiteDataSource.GetWebsite(iD));
            }
            catch
            {
                Website = WebsiteViewModel.FromWebsite(WebsiteDataSource.GetDefault());
            }
        }
Esempio n. 3
0
        private async Task PinTileAsync(long iD)
        {
            string tileId      = "website" + iD;
            string displayName = WebsiteDataSource.GetWebsite(iD).Name;
            string arguments   = iD.ToString();

            // Initialize the tile with required arguments
            SecondaryTile tile = new SecondaryTile(
                tileId,
                displayName,
                arguments,
                new Uri("ms-appx:///Assets/Square150x150Logo.png"),
                TileSize.Default);

            // Pin the tile
            bool isPinned = await tile.RequestCreateAsync();

            // TODO: Update UI to reflect whether user can now either unpin or pin
        }