Every one must have header about the panorama control available for the Windows Phone 7 applications. But have you created an app using it? Let's begin creating a simple news reader app using the panorama control.
At first, create a panorama application project in Visual Studio 2010. This adds a lot of files to your project, you may choose to just modify than or add your own files. The basic structure that VS 2010 creates for you is perfect for this app. Let us first concentrate on the UI design.
The app will have two panorama screens, the first one will display the top stories, while the other will show a list of news categories for the user to choose.
Every panorama screen has a title, that identifies what the screen is about or what you can expect it to have. I would be naming my screen "top stories". You might wonder why the lower case, well that's what most of the WP7 apps have titles, all in lower case.
The content of the screen is pretty straight forward, it contains a list box display all the news stories.
At first, create a panorama application project in Visual Studio 2010. This adds a lot of files to your project, you may choose to just modify than or add your own files. The basic structure that VS 2010 creates for you is perfect for this app. Let us first concentrate on the UI design.
The app will have two panorama screens, the first one will display the top stories, while the other will show a list of news categories for the user to choose.
Every panorama screen has a title, that identifies what the screen is about or what you can expect it to have. I would be naming my screen "top stories". You might wonder why the lower case, well that's what most of the WP7 apps have titles, all in lower case.
The content of the screen is pretty straight forward, it contains a list box display all the news stories.
<!--Panorama item one-->When the user selects any item in the list box, the user would be redirected to the browser display the entire article. Following code accomplishes this task for you.
<PanoramaItem Header="top stories">
<ListBox ItemsSource="{Binding TopStories}" SelectionChanged="MainListBox_SelectionChanged"><ListBox.ItemTemplate><DataTemplate><StackPanel Margin="0,0,0,17" Width="432"><TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle2Style}"/>
<TextBlock Text="{Binding PublishedDate}" TextWrapping="Wrap" Margin="12,5" Style="{StaticResource PhoneTextSmallStyle}" FontStyle="Italic"/>
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="12,2" Style="{StaticResource PhoneTextSubtleStyle}"/><!--StackPanel>--></DataTemplate><!--ListBox.ItemTemplate>--><!--ListBox>--></PanoramaItem>