Get the Owner's or Viewer's friends


  • StartIndex Gets the 1-based start index for the friends to return
  • Max Gets or sets the maximum number of friends to return (default is int.Max)
  • PageSize Gets or sets the number of friends to return per page (default is 20)
  • IdSpec the IdSpec the specifies whether you want to get the owner's or the viewer's friends. This can be either
    • "opensocial.IdSpec.PersonId.OWNER"
    • "opensocial.IdSpec.PersonId.VIEWER"
  • People Gets the collection of MyOpenSpace.Person friends for the owner or the viewer. This will only return basic information about the friends (Nickname, ID, ProfileUrl, ThumbnailImage)


Get up to 1,000 of the owner's friends paged in batches of 100 and show their DisplayName and profile picture in a ListBox that uses a WrapPanel. This is the Friends sample in the Kit Source Code.
<UserControl x:Class="Friends.Page"
        <MyOpenSpace:MySpacePeopleRequest x:Key="OwnerFriends" 
            IdSpec="opensocial.IdSpec.PersonId.OWNER" Max="1000" PageSize="100" />
        <DataTemplate x:Key="FriendTemplate">
            <Border Background="Silver" CornerRadius="4">
                <StackPanel Margin="2">
                    <Grid Height="100" Width="100">
                        <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Bottom"  
                              Text="" FontFamily="Webdings" FontSize="72" 
                              TextAlignment="Center" Margin="2"/>
                        <Image Margin="2" Source="{Binding ThumbnailImage}" />
                    <HyperlinkButton Foreground="Black" Margin="2" 
                        Content="{Binding DisplayName}" 
                        NavigateUri="{Binding ProfileUrl}"/>
        <ItemsPanelTemplate x:Key="FriendsPanel">
    <Grid x:Name="LayoutRoot" Background="White">
            ItemTemplate="{StaticResource FriendTemplate}" 
            ItemsPanel="{StaticResource FriendsPanel}"
            ItemsSource="{Binding People, Source={StaticResource OwnerFriends} }"

Last edited Apr 1, 2009 at 1:13 AM by mscherotter, version 22


No comments yet.