Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (108 sloc) 6.47 KB
<local:WazeApplicationPage
x:Class="WazeWP7.SingleSearchResultsPivotPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:local="clr-namespace:WazeWP7"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--Resources defining the look and feel of the results lists-->
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="SearchResultItemTemplate">
<Grid Tap="SearchResultItemGrid_Tap">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsZoomEnabled="False" FlowDirection="{Binding FlowDirection,ElementName=MainPivot}">
<toolkit:MenuItem Header="{Binding DataContext.DriveContextMenuItemHeader,ElementName=MainPivot}"
Name="Navigate" Click="MenuItem_Click"/>
<toolkit:MenuItem Header="{Binding DataContext.ShowContextMenuItemHeader,ElementName=MainPivot}"
Name="Show" Click="MenuItem_Click"/>
<toolkit:MenuItem Header="{Binding DataContext.AddToFavoritesContextMenuItemHeader,ElementName=MainPivot}"
Name="AddToFavorites" Click="MenuItem_Click"/>
<toolkit:MenuItem Header="{Binding DataContext.AddGeoReminderContextMenuItemHeader,ElementName=MainPivot}"
Name="AddGeoReminder" Click="MenuItem_Click"/>
<toolkit:MenuItem Header="{Binding DataContext.CancelContextMenuItemHeader,ElementName=MainPivot}"
Name="Cancel" Click="MenuItem_Click"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
<Image Grid.Column="0" Source="{Binding IconResource}" Height="50"/>
<TextBlock Grid.Column="1"
Text="{Binding Address}"
TextWrapping="Wrap" Style="{StaticResource PhoneTextNormalStyle}"
Foreground="Black"/>
</Grid>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="#FF46CBFF">
<!--Grid for displaying popups-->
<Grid x:Name="PopupsGrid" Canvas.ZIndex="1"
HorizontalAlignment="Center" VerticalAlignment="Stretch"/>
<Grid Background="Transparent" VerticalAlignment="Center"
Name="InputGrid" Canvas.ZIndex="1" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Row="0" Grid.RowSpan="3"
Grid.Column="0" Grid.ColumnSpan="3"
Fill="Black" Opacity="0.80"/>
<TextBlock Grid.Row="0" Grid.ColumnSpan="2"
HorizontalAlignment="Left" Name="InputLabel" Text="Name"
TextAlignment="Right" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBox Grid.Row="1" Grid.ColumnSpan="2"
HorizontalAlignment="Stretch" Name="InputTextBox" Text=""
KeyUp="InputText_KeyUp" TextAlignment="Right"/>
<Button Grid.Row="2" Grid.Column="0" x:Name="InputOkButton"
HorizontalAlignment="Center"
Click="InputOkButton_Click" Content="OK" />
<Button Grid.Row="2" Grid.Column="1" x:Name="InputCancelButton"
HorizontalAlignment="Center"
Click="InputCancelButton_Click" Content="Cancel"/>
</Grid>
<!--Pivot Control-->
<controls:Pivot x:Name="MainPivot">
<!--Pivot item one-->
<controls:PivotItem x:Name="NewAddressPivotItem" Header="New address">
<Grid Grid.Row="1" Margin="12,0,12,0">
<ListBox
x:Name="NewAddressListBox"
DataContext="{Binding PageContext}"
ItemsSource="{Binding AddressResults}"
Margin="12, 0, 12, 0"
ItemTemplate="{StaticResource SearchResultItemTemplate}"
ItemContainerStyle="{StaticResource WazeListBoxItemStyle}"/>
</Grid>
</controls:PivotItem>
<!--Pivot item two-->
<controls:PivotItem x:Name="LocalSearchPivotItem" Header="Local search">
<Grid Grid.Row="1" Margin="12,0,12,0">
<ListBox
x:Name="LocalSearchListBox"
DataContext="{Binding PageContext}"
ItemsSource="{Binding LocalSearchResults}"
Margin="12, 0, 12, 0"
ItemTemplate="{StaticResource SearchResultItemTemplate}"
ItemContainerStyle="{StaticResource WazeListBoxItemStyle}"/>
</Grid>
</controls:PivotItem>
</controls:Pivot>
</Grid>
</local:WazeApplicationPage>
Something went wrong with that request. Please try again.