Wriju's BLOG

.NET, Cloud and everything

Windows 8 Application and OData with Netflix

Windows 8 and OData goes hand in hand. Today while discussing with my sweetheart, I started working on this demo on how to consume OData with Windows 8 Style Application. It does not follow the UX design guideline. However, an honest attempt to demonstrate the capability.

I have used the most famous Netflix OData from http://odata.netflix.com/v2/Catalog/

So I have created the Blank Windows Store application


Then have added the reference


If you get an error, then most probably the WCF Component is not installed. Follow the error message and download from the link


After that add the below XAML in MainPage.xaml

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <RowDefinition Height="100"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    <Button x:Name="btnLoad" Content="Load Them" Grid.Row="0" FontSize="36" Click="btnLoad_Click"></Button>
    <ListBox x:Name="lstData" Grid.Row="1">
                <StackPanel Orientation="Horizontal">
                    <Image Stretch="Uniform" Height="100" Width="100" Margin="3,0">
                            <BitmapImage UriSource="{Binding Path=BoxArt.LargeUrl}"></BitmapImage>
                    <TextBlock Text="{Binding Path=Name}"></TextBlock>

After that C# Code would look like,

NetFlixSvc.NetflixCatalog context = new NetFlixSvc.NetflixCatalog(new Uri(@"http://odata.netflix.com/v2/Catalog/", UriKind.RelativeOrAbsolute));
DataServiceCollection<NetFlixSvc.Title> _titles;
public void LoadData()
    _titles = new DataServiceCollection<NetFlixSvc.Title>();
    var query = context.Titles;
    _titles.LoadCompleted += _titles_LoadCompleted;

void _titles_LoadCompleted(object sender, LoadCompletedEventArgs e)
    lstData.ItemsSource = _titles;

private void btnLoad_Click(object sender, RoutedEventArgs e)

The output looks like,


I am again telling that this violets the basic Windows 8 Style Application design guideline.