コード例 #1
0
        async void OnSelectedFriend(object sender, ItemTappedEventArgs e)
        {
            User u    = (User)e.Item;
            Page page = new FavouritesPage(this.MainPage, u.Id);

            page.Title = u.Name;

            this.MainPage.SetDetailPage(page);
        }
コード例 #2
0
        private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var item = e.SelectedItem as MainPageMenuItem;

            if (item == null)
            {
                return;
            }

            Page page = null;

            switch (item.Title)
            {
            case "Favourites":
                page = new FavouritesPage(this, AccountManager.GetAccountId());
                break;

            case "Movies":
                page = new MoviesPage(this);
                break;

            case "Songs":
                page = new SongsPage(this);
                break;

            case "Books":
                page = new BooksPage(this);
                break;

            case "Friends":
                page = new FriendsPage(this);
                break;

            case "Log out":
                AccountManager.LogOut();
                return;
            }

            page.Title = item.Title;

            SetDetailPage(page);

            MasterPage.ListView.SelectedItem = null;
        }