Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.32 KB | None | 0 0
  1. <prism:VisualStateAwarePage
  2. x:Name="pageRoot"
  3. x:Class="ModernShoppingList.Views.SearchResultsPage"
  4. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  5. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  6. xmlns:local="using:ModernShoppingList.Views"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
  10. xmlns:common="using:ModernShoppingList.Common"
  11. mc:Ignorable="d"
  12. prism:ViewModelLocator.AutoWireViewModel="True">
  13.  
  14. <prism:VisualStateAwarePage.Resources>
  15. <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
  16. <x:String x:Key="AppName">Search Results</x:String>
  17. </prism:VisualStateAwarePage.Resources>
  18.  
  19. <!--
  20. This grid acts as a root panel for the page that defines two rows:
  21. * Row 0 contains the back button and page title
  22. * Row 1 contains the rest of the page layout
  23. -->
  24. <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
  25. <Grid.ChildrenTransitions>
  26. <TransitionCollection>
  27. <EntranceThemeTransition/>
  28. </TransitionCollection>
  29. </Grid.ChildrenTransitions>
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="140"/>
  32. <RowDefinition Height="*"/>
  33. </Grid.RowDefinitions>
  34.  
  35. <!-- Back button and page title -->
  36. <Grid x:Name="headerGrid">
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="Auto" />
  39. <ColumnDefinition Width="Auto" />
  40. <ColumnDefinition Width="*" />
  41. </Grid.ColumnDefinitions>
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="*" />
  44. <RowDefinition Height="0" />
  45. </Grid.RowDefinitions>
  46. <Button x:Name="backButton"
  47. Style="{StaticResource BackButtonStyle}"
  48. Click="GoBack"
  49. IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" />
  50. <TextBlock x:Name="pageTitle"
  51. x:Uid="searchPageTitle"
  52. Grid.Column="1"
  53. Text="Search"
  54. IsHitTestVisible="false"
  55. Style="{StaticResource PageHeaderTextStyle}" />
  56. <StackPanel x:Name="searchHeader"
  57. Orientation="Horizontal"
  58. Grid.Column="2">
  59. <TextBlock x:Name="resultNumber"
  60. x:Uid="ResultsNumberLabel"
  61. Text="{Binding TotalCount}"
  62. IsHitTestVisible="false"
  63. Margin="0,0,10,40"
  64. Style="{StaticResource PageSubheaderTextStyle}" />
  65. <TextBlock x:Name="resultText"
  66. x:Uid="ResultsForLabel"
  67. Text="Results for"
  68. IsHitTestVisible="false"
  69. Margin="0,0,10,40"
  70. Style="{StaticResource PageSubheaderTextStyle}" />
  71. <TextBlock x:Name="queryText"
  72. Text="{Binding QueryText}"
  73. IsHitTestVisible="false"
  74. Style="{StaticResource PageSubheaderTextStyle}" />
  75. </StackPanel>
  76. </Grid>
  77. <Grid x:Name="resultsPanel" Grid.Row="1">
  78. <!--
  79. Dans la plupart des états d'affichage, le corps de la page utilise des contrôles d'éléments pour créer plusieurs cases d'option
  80. en vue d'un filtrage sur une grille de résultats de recherche à défilement horizontal
  81. -->
  82. <Grid x:Name="typicalPanel">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="Auto"/>
  85. <RowDefinition Height="*"/>
  86. </Grid.RowDefinitions>
  87. <!--
  88. <ItemsControl
  89. x:Name="filtersItemsControl"
  90. Canvas.ZIndex="1"
  91. Margin="120,-3,120,30"
  92. ItemsSource="{Binding Source={StaticResource filtersViewSource}}"
  93. Visibility="{Binding ShowFilters, Converter={StaticResource BooleanToVisibilityConverter}}">
  94.  
  95. <ItemsControl.ItemsPanel>
  96. <ItemsPanelTemplate>
  97. <StackPanel Orientation="Horizontal"/>
  98. </ItemsPanelTemplate>
  99. </ItemsControl.ItemsPanel>
  100. <ItemsControl.ItemTemplate>
  101. <DataTemplate>
  102. <RadioButton
  103. Margin="0,0,30,0"
  104. GroupName="Filters"
  105. IsChecked="{Binding Active, Mode=TwoWay}"
  106. Checked="Filter_Checked"
  107. Style="{StaticResource TextBlockButtonStyle}">
  108. <TextBlock Text="{Binding Description}" TextWrapping="NoWrap"
  109. Margin="3,-7,3,10" Style="{StaticResource SubheaderTextBlockStyle}" />
  110. </RadioButton>
  111. </DataTemplate>
  112. </ItemsControl.ItemTemplate>
  113. </ItemsControl>
  114. -->
  115.  
  116. <GridView
  117. x:Name="resultsGridView"
  118. AutomationProperties.AutomationId="ResultsGridView"
  119. AutomationProperties.Name="Search Results"
  120. TabIndex="1"
  121. Grid.Row="1"
  122. Margin="0,-238,0,0"
  123. Padding="110,240,110,46"
  124. SelectionMode="None"
  125. IsSwipeEnabled="false"
  126. IsItemClickEnabled="True"
  127. common:ListViewItemClickedToAction.Action="{Binding NavDetailCommand}"
  128. ItemsSource="{Binding Results}">
  129. <GridView.ItemTemplate>
  130. <DataTemplate>
  131. <Grid Width="294" Margin="6">
  132. <Grid.ColumnDefinitions>
  133. <ColumnDefinition Width="Auto"/>
  134. <ColumnDefinition Width="*"/>
  135. </Grid.ColumnDefinitions>
  136. <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
  137. <Image Source="{Binding Picture}" Stretch="UniformToFill"/>
  138. </Border>
  139. <StackPanel Grid.Column="1" Margin="10,-10,0,0">
  140. <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource BodyTextBlockStyle}"/>
  141. <!--<TextBlock Text="{Binding Subtitle}" TextWrapping="NoWrap" Style="{StaticResource BodyTextBlockStyle}" Foreground="{ThemeResource ApplicationSecondaryForegroundThemeBrush}"/>
  142. <TextBlock Text="{Binding Description}" TextWrapping="NoWrap" Style="{StaticResource BodyTextBlockStyle}" Foreground="{ThemeResource ApplicationSecondaryForegroundThemeBrush}"/>-->
  143. </StackPanel>
  144. </Grid>
  145. </DataTemplate>
  146. </GridView.ItemTemplate>
  147. <GridView.ItemContainerStyle>
  148. <Style TargetType="Control">
  149. <Setter Property="Height" Value="70"/>
  150. <Setter Property="Margin" Value="0,0,38,8"/>
  151. </Style>
  152. </GridView.ItemContainerStyle>
  153. </GridView>
  154. </Grid>
  155. </Grid>
  156.  
  157. <TextBlock
  158. x:Name="noResultsTextBlock"
  159. Grid.Row="1"
  160. Margin="120,50,0,0"
  161. Visibility="Collapsed"
  162. Style="{StaticResource SubheaderTextBlockStyle}"
  163. Text="No results match your search." />
  164.  
  165. <VisualStateManager.VisualStateGroups>
  166. <VisualStateGroup x:Name="ResultStates">
  167. <VisualState x:Name="ResultsFound" />
  168. <!-- S'il n'y a aucun résultat, le panneau de résultats est remplacé par un TextBlock d'informations -->
  169. <VisualState x:Name="NoResultsFound">
  170. <Storyboard>
  171. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="resultsGridView" Storyboard.TargetProperty="Visibility">
  172. <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
  173. </ObjectAnimationUsingKeyFrames>
  174. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="noResultsTextBlock" Storyboard.TargetProperty="Visibility">
  175. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  176. </ObjectAnimationUsingKeyFrames>
  177. </Storyboard>
  178. </VisualState>
  179. </VisualStateGroup>
  180. </VisualStateManager.VisualStateGroups>
  181.  
  182. </Grid>
  183. </prism:VisualStateAwarePage>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement