imrpovements

This commit is contained in:
2011-04-04 09:47:17 +03:00
parent d70777bfec
commit 2de2c2485e
5 changed files with 59 additions and 22 deletions
@@ -228,9 +228,15 @@
<Content Include="icons\anonymousIcon.png"> <Content Include="icons\anonymousIcon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="icons\appbar.add.rest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="icons\appbar.feature.settings.rest.png"> <Content Include="icons\appbar.feature.settings.rest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="icons\appbar.minus.rest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="icons\appbar.publish.png"> <Content Include="icons\appbar.publish.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@@ -69,6 +69,8 @@ namespace MyFriendsAround.WP7.ViewModel
CropCancelCommand = new RelayCommand(() => CropCancel()); CropCancelCommand = new RelayCommand(() => CropCancel());
MapViewChangedCommand = new RelayCommand<LocationRect>(boundRectangle => MapViewChanged(boundRectangle)); MapViewChangedCommand = new RelayCommand<LocationRect>(boundRectangle => MapViewChanged(boundRectangle));
ShowMyLocationCommand = new RelayCommand(() => ShowMyLocation()); ShowMyLocationCommand = new RelayCommand(() => ShowMyLocation());
MapZoomInCommand = new RelayCommand(() => MapZoomIn());
MapZoomOutCommand = new RelayCommand(() => MapZoomOut());
if (IsInDesignMode) if (IsInDesignMode)
{ {
@@ -89,6 +91,24 @@ namespace MyFriendsAround.WP7.ViewModel
InitGps(); InitGps();
} }
private void MapZoomOut()
{
//
if(MapZoom<22)
{
MapZoom++;
}
}
private void MapZoomIn()
{
//
if (MapZoom >2 )
{
MapZoom--;
}
}
private void InitGps() private void InitGps()
{ {
@@ -286,12 +306,12 @@ namespace MyFriendsAround.WP7.ViewModel
/// The <see cref="MyPicture" /> property's name. /// The <see cref="MyPicture" /> property's name.
/// </summary> /// </summary>
public const string MyPicturePropertyName = "MyPicture"; public const string MyPicturePropertyName = "MyPicture";
private BitmapSource _myPicture = new BitmapImage(new Uri("/icons/anonymousIcon.png", UriKind.RelativeOrAbsolute)); private ImageSource _myPicture = new BitmapImage(new Uri("/icons/anonymousIcon.png", UriKind.RelativeOrAbsolute));
/// <summary> /// <summary>
/// Gets the MyPicture property. /// Gets the MyPicture property.
/// </summary> /// </summary>
public BitmapSource MyPicture public ImageSource MyPicture
{ {
get get
{ {
@@ -586,6 +606,8 @@ namespace MyFriendsAround.WP7.ViewModel
public ICommand CropSaveCommand { get; set; } public ICommand CropSaveCommand { get; set; }
public ICommand CropCancelCommand { get; set; } public ICommand CropCancelCommand { get; set; }
public ICommand MapViewChangedCommand { get; set; } public ICommand MapViewChangedCommand { get; set; }
public ICommand MapZoomInCommand { get; set; }
public ICommand MapZoomOutCommand { get; set; }
#endregion #endregion
+21 -12
View File
@@ -144,31 +144,41 @@
<Grid HorizontalAlignment="Right" <Grid HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Width="64" Width="64">
>
<Rectangle RadiusX="10" <Rectangle RadiusX="10"
RadiusY="10" RadiusY="10"
Fill="Black" Fill="Black"
Opacity="0.3" Opacity="0.3"
Margin="0,0,-20,0" Margin="0,0,-20,0">
>
</Rectangle> </Rectangle>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Stretch"> <StackPanel HorizontalAlignment="Left"
<Image Source="/icons/appbar.location.png" VerticalAlignment="Stretch">
<Image Source="/icons/appbar.add.rest.png"
Margin="0" Margin="0"
Width="64" Width="64"
Height="64" Height="64"
VerticalAlignment="Top" VerticalAlignment="Top"
HorizontalAlignment="Left" HorizontalAlignment="Left">
/> <i:Interaction.Triggers>
<Image Source="/icons/appbar.location.png" <i:EventTrigger EventName="MouseLeftButtonDown">
<cmd:EventToCommand Command="{Binding MapZoomOutCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
<Image Source="/icons/appbar.minus.rest.png"
Margin="0" Margin="0"
Width="64" Width="64"
Height="64" Height="64"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
HorizontalAlignment="Left" /> HorizontalAlignment="Left">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<cmd:EventToCommand Command="{Binding MapZoomInCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</StackPanel> </StackPanel>
</Grid> </Grid>
@@ -200,8 +210,7 @@
Opacity="1" Opacity="1"
Source="{Binding MyPicture, Mode=OneWay}" Source="{Binding MyPicture, Mode=OneWay}"
Margin="0" Margin="0"
Stretch="Fill" Stretch="Fill">
>
</Image> </Image>
<Border Background="{StaticResource PhoneAccentBrush}" <Border Background="{StaticResource PhoneAccentBrush}"
Width="80" Width="80"
Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B