Now you can build Silverlight applications for the MySpace Developer Platform! I have been working with MySpace for months on this initiative and now we have some exciting results:
As the MySpace Developer Platform grows and evolves, we want to keep Silverlight as a relevant option for designers and developers who want to create engaging, interactive application for MySpace users. Working with developers at MySpace we’ve created a kit that would let designers with Expression Blend use data binding in Silverlight to connect to the data provided by the MySpace Developer Platform. We’ve even added design-time and offline sample data to the kit to aid in development.
In this example below, I’m data binding the MySpace page owner’s friends to a ListBox and using a data template for each item returned:
And the XAML for this simple application is this (no code has been added to the application):
<UserControl x:Class="Test_Silverlight_Kit_for_MySpace.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:MyOpenSpace="clr-namespace:MyOpenSpace;assembly=MySpaceSilverlightKit" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <UserControl.Resources> <MyOpenSpace:MySpacePeopleRequest x:Key="OwnerFriends" IdSpec="opensocial.IdSpec.PersonId.OWNER" /> <DataTemplate x:Key="PersonTemplate"> <Border ToolTipService.ToolTip="{Binding Path=Status}" Height="Auto" Width="Auto" Padding="4,4,4,4" CornerRadius="4,4,4,4" BorderBrush="#FF000000" BorderThickness="0,0,2,2"> <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFFFFFFF" Offset="0"/> <GradientStop Color="#FF007EE8" Offset="1"/> </LinearGradientBrush> </Border.Background> <Grid Height="Auto" Width="Auto"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Image Source="{Binding Mode=OneWay, Path=ThumbnailImage}" Width="100" Height="100" HorizontalAlignment="Stretch" Margin="2.5,2.5,2.5,2.5"/> <HyperlinkButton TargetName="_blank" NavigateUri="{Binding Path=ProfileUrl}" Grid.Row="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0"> <TextBlock Foreground="#FFFFFFFF" Text="{Binding Path=Nickname}" TextWrapping="Wrap" FontFamily="Trebuchet MS" FontSize="10" Height="Auto" Width="Auto" TextAlignment="Center"/> </HyperlinkButton> </Grid> </Border> </DataTemplate> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <ListBox ItemTemplate="{StaticResource PersonTemplate}" ItemsSource="{Binding People, Source={StaticResource OwnerFriends}}"/> </Grid> </UserControl>
I can’t wait to see what cool applications people build with this kit. Watch (or subscribe) this blog for more news.