map issue fixed

This commit is contained in:
2011-04-04 03:04:43 +03:00
parent fd9061e6c5
commit a9533b651c
6 changed files with 452 additions and 332 deletions
+57 -38
View File
@@ -20,7 +20,7 @@
DataContext="{Binding Main, Source={StaticResource Locator}}"
xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
xmlns:Preview="clr-namespace:Phone7.Fx.Preview;assembly=Phone7.Fx.Preview"
xmlns:binding="clr-namespace:Coding4Fun.Phone.Controls.Binding;assembly=Coding4Fun.Phone.Controls">
xmlns:binding="clr-namespace:Coding4Fun.Phone.Controls.Binding;assembly=Coding4Fun.Phone.Controls" xmlns:Core="clr-namespace:Microsoft.Phone.Controls.Maps.Core;assembly=Microsoft.Phone.Controls.Maps">
<!--LayoutRoot contains the root grid where all other page content is placed-->
@@ -41,18 +41,17 @@
<Grid x:Name="ContentGrid">
<StackPanel Orientation="Vertical">
<Grid Background="{TemplateBinding Background}"
HorizontalAlignment="Left"
MinHeight="10"
MinWidth="29">
HorizontalAlignment="Left">
<Image x:Name="imgFriend"
Source="{Binding PinImageUrl, Mode=OneWay}"
Margin="2, 2, 2, 24" Width="48" Height="48"
Stretch="Fill">
</Image>
<TextBlock HorizontalAlignment="Left" Text="{Binding PinUserName}" VerticalAlignment="Bottom"
Margin="1" Width="48" Height="24" />
<TextBlock HorizontalAlignment="Left"
Text="{Binding PinUserName, Mode=OneWay}"
VerticalAlignment="Bottom"
Margin="1" Width="48" Height="24" />
</Grid>
<Polygon Fill="{TemplateBinding Background}"
Points="0,0 29,0 0,29"
Width="29"
@@ -77,7 +76,22 @@
</Grid.RowDefinitions>
<!--ContentPanel - place additional content here-->
<Grid.Resources>
<DataTemplate x:Key="LogoTemplate">
<my:Pushpin Location="{Binding Location}"
Background="{StaticResource PhoneAccentBrush}"
Template="{StaticResource PushpinControlTemplate2}">
</my:Pushpin>
</DataTemplate>
<my:MapItemsControl x:Name="GroupAPins"
ItemTemplate="{StaticResource LogoTemplate}"
ItemsSource="{Binding PushPins}"
>
</my:MapItemsControl>
</Grid.Resources>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentGrid"
Grid.Row="0" VerticalAlignment="Stretch"
Grid.RowSpan="2"
@@ -101,19 +115,35 @@
Margin="6,0,6,0"
VerticalAlignment="Stretch"
Center="{Binding Path=MapCenter, Mode=TwoWay}"
ZoomLevel="{Binding Path=MapZoom, Mode=TwoWay}"
ZoomLevel="{Binding Path=MapZoom, Mode=TwoWay}"
AnimationLevel="Full"
ViewChangeEnd="map_ViewChangeEnd"
>
<my:MapItemsControl ItemsSource="{Binding PushPins}">
<my:MapItemsControl.ItemTemplate>
<DataTemplate>
<my:Pushpin Location="{Binding Location}"
Background="{StaticResource PhoneAccentBrush}"
Template="{StaticResource PushpinControlTemplate2}">
</my:Pushpin>
</DataTemplate>
</my:MapItemsControl.ItemTemplate>
</my:MapItemsControl>
<my:MapLayer x:Name="layerFriends">
<my:MapItemsControl ItemsSource="{Binding VisiblePushPins}"
ItemTemplate="{StaticResource LogoTemplate}">
</my:MapItemsControl>
</my:MapLayer>
<my:MapLayer x:Name="layerMyLocation">
<my:MapItemsControl>
</my:MapItemsControl>
</my:MapLayer>
</my:Map>
<StackPanel HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Black"
Opacity="0.5"
>
<Image Source="/icons/appbar.location.png"
Margin="10"
Width="64"
Height="64" />
<Image Source="/icons/appbar.location.png"
Margin="10"
Width="64"
Height="64" />
</StackPanel>
</Grid>
@@ -131,14 +161,14 @@
Foreground="{StaticResource PhoneAccentBrush}"
Style="{StaticResource PhoneTextNormalStyle}" />
<Grid Margin="0,6,6,6"
Height="80">
Height="80" >
<Grid Width="80"
Height="80"
HorizontalAlignment="Right"
Background="Transparent"
Opacity="1"
>
<Image x:Name="imgMine"
<Image x:Name="imgMine" Opacity="1"
Source="{Binding MyPicture, Mode=OneWay}" Margin="0" Stretch="Fill" >
</Image>
<Border Background="{StaticResource PhoneAccentBrush}"
@@ -146,7 +176,7 @@
Height="25"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
BorderThickness="0">
BorderThickness="0" Opacity="1">
<TextBlock x:Name="txtMyName"
Style="{StaticResource PhoneTextNormalStyle}"
FontSize="16"
@@ -154,7 +184,7 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="2"
Text="{Binding MyName, Mode=OneWay}" />
Text="{Binding MyName, Mode=OneWay}" Opacity="1" />
</Border>
</Grid>
@@ -172,6 +202,10 @@
<Preview:BindableApplicationBar x:Name="AppBar"
BarOpacity="0.8">
<Preview:BindableApplicationBarIconButton Command="{Binding ShowMyLocationCommand}"
IconUri="/icons/appbar.location.png"
Text="{Binding AppBarTextMyLocation}"
IsEnabled="{Binding Path=IsBusy, Converter={StaticResource InvertValueConverter1}}" />
<Preview:BindableApplicationBarIconButton Command="{Binding RefreshFriendsCommand}"
IconUri="/icons/appbar.sync.rest.png"
Text="{Binding AppBarTextRefresh}" IsEnabled="{Binding Path=IsBusy, Converter={StaticResource InvertValueConverter1}}" />
@@ -189,19 +223,4 @@
</Preview:BindableApplicationBar>
</Grid>
<!-- Sample code showing usage of ApplicationBar
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"></shell:ApplicationBarIconButton>
<shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"></shell:ApplicationBarIconButton>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"></shell:ApplicationBarMenuItem>
<shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"></shell:ApplicationBarMenuItem>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
-->
</phone:PhoneApplicationPage>