Created
December 27, 2013 17:01
-
-
Save SoulFireMage/8149646 to your computer and use it in GitHub Desktop.
OData with Netflix from 2012
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type netflix = ODataService<"http://odata.netflix.com/Catalog/"> | |
let films = netflix.GetDataContext() | |
let FilmSearch title number = | |
query { | |
for film in films.Titles do | |
where (film.Name.Contains title) | |
take number | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This belongs to the F# dll above. | |
Function buildFilmStackPanel(Title As netflix.ServiceTypes.Title) | |
Dim stack As New StackPanel | |
Dim Filmtitle As New Label With {.Content = Title.Name, .ClipToBounds = True} | |
Dim Synopsis As New TextBlock With {.Text = Title.Synopsis, .TextWrapping = TextWrapping.Wrap, .FontSize = 10, .ClipToBounds = True, .MaxWidth = 400} | |
Dim imageStr As String = Title.BoxArt.MediumUrl | |
Dim image As New Image() With {.Source = New BitmapImage(New Uri(imageStr)), | |
.Width = 256, | |
.HorizontalAlignment = Windows.HorizontalAlignment.Left} | |
stack.Children.Add(Filmtitle) | |
stack.Children.Add(Synopsis) | |
stack.Children.Add(image) | |
Return stack | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment