MainPano.xaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!--
  2. Copyright © 2011-2012 Nokia Corporation. All rights reserved.
  3. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation.
  4. Other product and company names mentioned herein may be trademarks
  5. or trade names of their respective owners.
  6. See LICENSE.TXT for license information.
  7. -->
  8. <phone:PhoneApplicationPage
  9. x:Class="RSSReader.Views.MainPano"
  10. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  11. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  12. xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  13. xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  14. xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
  15. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  16. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  17. xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
  18. mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
  19. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  20. FontSize="{StaticResource PhoneFontSizeNormal}"
  21. Foreground="Black"
  22. SupportedOrientations="Portrait" Orientation="Portrait"
  23. shell:SystemTray.IsVisible="False">
  24. <phone:PhoneApplicationPage.Resources>
  25. <Style x:Key="FeedGridItemStyle" TargetType="Button">
  26. <Setter Property="Background" Value="Transparent"/>
  27. <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
  28. <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
  29. <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
  30. <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
  31. <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
  32. <Setter Property="Padding" Value="10,3,10,5"/>
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="Button">
  36. <Grid Background="Transparent">
  37. <VisualStateManager.VisualStateGroups>
  38. <VisualStateGroup x:Name="CommonStates">
  39. <VisualState x:Name="Normal"/>
  40. <VisualState x:Name="MouseOver"/>
  41. <VisualState x:Name="Pressed"/>
  42. <VisualState x:Name="Disabled"/>
  43. </VisualStateGroup>
  44. </VisualStateManager.VisualStateGroups>
  45. <Grid Height="180" Margin="8,8,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="180">
  46. <Image Source="{Binding ImageURL}"/>
  47. <TextBlock Margin="8,0,8,8" TextWrapping="Wrap" VerticalAlignment="Bottom" Height="27" Text="{Binding Title}" d:LayoutOverrides="VerticalAlignment" Foreground="Black" />
  48. </Grid>
  49. </Grid>
  50. </ControlTemplate>
  51. </Setter.Value>
  52. </Setter>
  53. </Style>
  54. <DataTemplate x:Key="FeedGridItemTemplate">
  55. <Button Style="{StaticResource FeedGridItemStyle}"
  56. Click="Button_Click"/>
  57. </DataTemplate>
  58. <ItemsPanelTemplate x:Key="FeedGridPanelTemplate">
  59. <!-- WrapPanel is part of Silverlight Toolkit which does not ship as part of this
  60. example. Please see release notes for instructions how to install and use
  61. Silverlight Toolkit. -->
  62. <toolkit:WrapPanel/>
  63. </ItemsPanelTemplate>
  64. </phone:PhoneApplicationPage.Resources>
  65. <Grid x:Name="LayoutRoot" Background="Transparent">
  66. <controls:Panorama Title="rss reader" x:Name="RSSFeedsPanorama" Foreground="Black">
  67. <controls:Panorama.Background>
  68. <ImageBrush ImageSource="/Resources/newspaper-background.jpg" />
  69. </controls:Panorama.Background>
  70. <controls:PanoramaItem DataContext="{Binding Source={StaticResource RSSPagesDataSource}, Path=FirstPage}">
  71. <controls:PanoramaItem.Header>
  72. <StackPanel Orientation="Horizontal">
  73. <TextBlock Text="{Binding Title}" />
  74. <Button Click="SettingsButton_Click" Margin="0,10,0,0" BorderThickness="0">
  75. <Image Source="/Resources/appbar.feature.settings.rest.png" Width="60" />
  76. </Button>
  77. </StackPanel>
  78. </controls:PanoramaItem.Header>
  79. <controls:PanoramaItem.Content>
  80. <ListBox Name="NewsFeedsListBox"
  81. toolkit:TiltEffect.IsTiltEnabled="True"
  82. ItemTemplate="{StaticResource FeedGridItemTemplate}"
  83. ItemsSource="{Binding FeedsView.View}"
  84. ItemsPanel="{StaticResource FeedGridPanelTemplate}"
  85. Margin="25,0,0,0"/>
  86. </controls:PanoramaItem.Content>
  87. </controls:PanoramaItem>
  88. <controls:PanoramaItem DataContext="{Binding Source={StaticResource RSSPagesDataSource}, Path=SecondPage}">
  89. <controls:PanoramaItem.Header>
  90. <StackPanel Orientation="Horizontal">
  91. <TextBlock Text="{Binding Title}" />
  92. <Button Click="SettingsButton_Click" Margin="0,10,0,0" BorderThickness="0">
  93. <Image Source="/Resources/appbar.feature.settings.rest.png" Width="60" />
  94. </Button>
  95. </StackPanel>
  96. </controls:PanoramaItem.Header>
  97. <controls:PanoramaItem.Content>
  98. <ListBox Name="LeisureListBox"
  99. toolkit:TiltEffect.IsTiltEnabled="True"
  100. ItemTemplate="{StaticResource FeedGridItemTemplate}"
  101. ItemsSource="{Binding FeedsView.View}"
  102. ItemsPanel="{StaticResource FeedGridPanelTemplate}"
  103. Margin="25,0,0,0"/>
  104. </controls:PanoramaItem.Content>
  105. </controls:PanoramaItem>
  106. <controls:PanoramaItem DataContext="{Binding Source={StaticResource RSSPagesDataSource}, Path=ThirdPage}">
  107. <controls:PanoramaItem.Header>
  108. <StackPanel Orientation="Horizontal">
  109. <TextBlock Text="{Binding Title}" />
  110. <Button Click="SettingsButton_Click" Margin="0,10,0,0" BorderThickness="0">
  111. <Image Source="/Resources/appbar.feature.settings.rest.png" Width="60" />
  112. </Button>
  113. </StackPanel>
  114. </controls:PanoramaItem.Header>
  115. <controls:PanoramaItem.Content>
  116. <ListBox Name="SportsFeedsListBox"
  117. toolkit:TiltEffect.IsTiltEnabled="True"
  118. ItemTemplate="{StaticResource FeedGridItemTemplate}"
  119. ItemsSource="{Binding FeedsView.View}"
  120. ItemsPanel="{StaticResource FeedGridPanelTemplate}"
  121. Margin="25,0,0,0"/>
  122. </controls:PanoramaItem.Content>
  123. </controls:PanoramaItem>
  124. <controls:PanoramaItem DataContext="{Binding Source={StaticResource RSSPagesDataSource}, Path=FourthPage}">
  125. <controls:PanoramaItem.Header>
  126. <StackPanel Orientation="Horizontal">
  127. <TextBlock Text="{Binding Title}" />
  128. <Button Click="SettingsButton_Click" Margin="0,10,0,0" BorderThickness="0">
  129. <Image Source="/Resources/appbar.feature.settings.rest.png" Width="60" />
  130. </Button>
  131. </StackPanel>
  132. </controls:PanoramaItem.Header>
  133. <controls:PanoramaItem.Content>
  134. <ListBox Name="TechFeedsListBox"
  135. toolkit:TiltEffect.IsTiltEnabled="True"
  136. ItemTemplate="{StaticResource FeedGridItemTemplate}"
  137. ItemsSource="{Binding FeedsView.View}"
  138. ItemsPanel="{StaticResource FeedGridPanelTemplate}"
  139. Margin="25,0,0,0"/>
  140. </controls:PanoramaItem.Content>
  141. </controls:PanoramaItem>
  142. </controls:Panorama>
  143. </Grid>
  144. </phone:PhoneApplicationPage>