mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 13:02:05 +03:00
gps location and publish improvements
This commit is contained in:
@@ -62,6 +62,22 @@
|
||||
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
||||
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'GPS_EMULATOR|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\GPS_EMULATOR\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;GPS_EMULATOR</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisLogFile>Bin\Debug\MyFriendsAround.WP7.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Coding4Fun.Phone.Controls, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Coding4Fun.Phone.Controls.Complete.1.2\lib\Coding4Fun.Phone.Controls.dll</HintPath>
|
||||
|
||||
@@ -27,6 +27,7 @@ using Microsoft.Silverlight.Testing;
|
||||
using MyFriendsAround.Common.Entities;
|
||||
using MyFriendsAround.WP7.Service;
|
||||
using MyFriendsAround.WP7.Utils;
|
||||
using MyFriendsAround.WP7.ViewModel;
|
||||
using MyFriendsAround.WP7.Views;
|
||||
using NetworkDetection;
|
||||
using Newtonsoft.Json;
|
||||
@@ -78,10 +79,75 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
// Code runs "for real"
|
||||
}
|
||||
|
||||
photoChooserTask = new PhotoChooserTask();
|
||||
photoChooserTask.Completed += cameraTask_Completed;
|
||||
//photoChooserTask.PixelHeight = 100;
|
||||
//photoChooserTask.PixelWidth = 100;
|
||||
photoChooserTask.ShowCamera = true;
|
||||
|
||||
//init GPS
|
||||
InitGps();
|
||||
}
|
||||
|
||||
|
||||
#region Properties
|
||||
private void InitGps()
|
||||
{
|
||||
#if GPS_EMULATOR
|
||||
_gpsWatcher = new GpsEmulatorClient.GeoCoordinateWatcher();
|
||||
#else
|
||||
_gpsWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High)
|
||||
{
|
||||
MovementThreshold = 10
|
||||
};
|
||||
#endif
|
||||
_gpsWatcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
|
||||
_gpsWatcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
|
||||
|
||||
//
|
||||
_gpsWatcher.Start();
|
||||
}
|
||||
|
||||
void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
|
||||
{
|
||||
GpsStatus = e.Status;
|
||||
}
|
||||
|
||||
void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
|
||||
{
|
||||
if (e.Position.Location != GeoCoordinate.Unknown)
|
||||
{
|
||||
GpsTimestamp = e.Position.Timestamp;
|
||||
GpsLocation = e.Position.Location;
|
||||
|
||||
if (LastBoundRect.Intersects(new LocationRect(GpsLocation, .5, .5)))
|
||||
{
|
||||
ObservableCollection<PushPinModel> _mynewlocation = new ObservableCollection<PushPinModel>();
|
||||
_mynewlocation.Add(new PushPinModel()
|
||||
{
|
||||
Location = GpsLocation,
|
||||
PinUserName = "Me"
|
||||
});
|
||||
MyLocationPushPins = _mynewlocation;
|
||||
}
|
||||
else
|
||||
{
|
||||
MyLocationPushPins = new ObservableCollection<PushPinModel>();
|
||||
}
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("watcher_PositionChanged + " + DateTime.Now.Second);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
private PhotoChooserTask photoChooserTask;
|
||||
private IGeoPositionWatcher<GeoCoordinate> _gpsWatcher;
|
||||
|
||||
|
||||
public string ApplicationTitle
|
||||
{
|
||||
@@ -92,7 +158,6 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region PageTitles
|
||||
|
||||
public string PageName
|
||||
@@ -120,19 +185,113 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GpsLocation" /> property's name.
|
||||
/// </summary>
|
||||
public const string GpsLocationPropertyName = "GpsLocation";
|
||||
|
||||
private GeoCoordinate _gpsLocation = GeoCoordinate.Unknown;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GpsLocation property.
|
||||
/// </summary>
|
||||
public GeoCoordinate GpsLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return _gpsLocation;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (_gpsLocation == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_gpsLocation = value;
|
||||
|
||||
// Update bindings, no broadcast
|
||||
RaisePropertyChanged(GpsLocationPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GpsTimestamp" /> property's name.
|
||||
/// </summary>
|
||||
public const string GpsTimestampPropertyName = "GpsTimestamp";
|
||||
|
||||
private DateTimeOffset _gpsTimestamp = DateTimeOffset.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GpsTimestamp property.
|
||||
/// </summary>
|
||||
public DateTimeOffset GpsTimestamp
|
||||
{
|
||||
get
|
||||
{
|
||||
return _gpsTimestamp;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (_gpsTimestamp == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_gpsTimestamp = value;
|
||||
|
||||
// Update bindings, no broadcast
|
||||
RaisePropertyChanged(GpsTimestampPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GpsStatus" /> property's name.
|
||||
/// </summary>
|
||||
public const string GpsStatusPropertyName = "GpsStatus";
|
||||
|
||||
private GeoPositionStatus _gpsStatus = GeoPositionStatus.Disabled;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GpsStatus property.
|
||||
/// </summary>
|
||||
public GeoPositionStatus GpsStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
return _gpsStatus;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (_gpsStatus == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_gpsStatus = value;
|
||||
|
||||
// Update bindings, no broadcast
|
||||
RaisePropertyChanged(GpsStatusPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="MyPicture" /> property's name.
|
||||
/// </summary>
|
||||
public const string MyPicturePropertyName = "MyPicture";
|
||||
private ImageSource _myPicture = new BitmapImage(new Uri("/icons/anonymousIcon.png", UriKind.RelativeOrAbsolute));
|
||||
private BitmapSource _myPicture = new BitmapImage(new Uri("/icons/anonymousIcon.png", UriKind.RelativeOrAbsolute));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MyPicture property.
|
||||
/// </summary>
|
||||
public ImageSource MyPicture
|
||||
public BitmapSource MyPicture
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -256,7 +415,7 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
public const string VisiblePushPinsPropertyName = "VisiblePushPins";
|
||||
private ObservableCollection<PushPinModel> _VisiblePushPins = new ObservableCollection<PushPinModel>();
|
||||
/// <summary>
|
||||
/// Gets the PushPins property.
|
||||
/// Gets the VisiblePushPins property.
|
||||
/// </summary>
|
||||
public ObservableCollection<PushPinModel> VisiblePushPins
|
||||
{
|
||||
@@ -280,6 +439,37 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="MyLocationPushPins" /> property's name.
|
||||
/// </summary>
|
||||
public const string MyLocationPushPinsPropertyName = "MyLocationPushPins";
|
||||
private ObservableCollection<PushPinModel> _MyLocationPushPins = new ObservableCollection<PushPinModel>();
|
||||
/// <summary>
|
||||
/// Gets the MyLocationPushPins property.
|
||||
/// </summary>
|
||||
public ObservableCollection<PushPinModel> MyLocationPushPins
|
||||
{
|
||||
get
|
||||
{
|
||||
return _MyLocationPushPins;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (_MyLocationPushPins == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_MyLocationPushPins = value;
|
||||
|
||||
// Update bindings, no broadcast
|
||||
RaisePropertyChanged(MyLocationPushPinsPropertyName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="MapZoom" /> property's name.
|
||||
/// </summary>
|
||||
@@ -404,20 +594,34 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
private void ShowMyLocation()
|
||||
{
|
||||
//
|
||||
if (GpsLocation != GeoCoordinate.Unknown &&
|
||||
GpsStatus == GeoPositionStatus.Ready
|
||||
)
|
||||
{
|
||||
MapCenter = GpsLocation;
|
||||
}
|
||||
}
|
||||
|
||||
private LocationRect LastBoundRect = null;
|
||||
private void MapViewChanged(LocationRect boundRectangle)
|
||||
{
|
||||
LastBoundRect = boundRectangle;
|
||||
//
|
||||
ObservableCollection<PushPinModel> _newVisiblePushPins = new ObservableCollection<PushPinModel>();
|
||||
//filter visible pushpins
|
||||
foreach (PushPinModel pushPin in PushPins)
|
||||
{
|
||||
if (boundRectangle.Intersects(new LocationRect(pushPin.Location, .5, .5)))
|
||||
if (LastBoundRect.Intersects(new LocationRect(pushPin.Location, .5, .5)))
|
||||
{
|
||||
_newVisiblePushPins.Add(pushPin);
|
||||
}
|
||||
}
|
||||
VisiblePushPins = _newVisiblePushPins;
|
||||
//
|
||||
if (!LastBoundRect.Intersects(new LocationRect(GpsLocation, .5, .5)))
|
||||
{
|
||||
MyLocationPushPins = new ObservableCollection<PushPinModel>();
|
||||
}
|
||||
}
|
||||
|
||||
public void CropCancel()
|
||||
@@ -453,7 +657,9 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream(img))
|
||||
{
|
||||
Container.Instance.Resolve<MainViewModel>("MainViewModel").MyPicture = PictureDecoder.DecodeJpeg(ms);
|
||||
BitmapImage bi = new BitmapImage();
|
||||
bi.SetSource(ms);
|
||||
Container.Instance.Resolve<MainViewModel>("MainViewModel").MyPicture = bi;// PictureDecoder.DecodeJpeg(ms);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -482,13 +688,8 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
PhotoChooserTask photoChooserTask = new PhotoChooserTask();
|
||||
private void ShowPhotoChooserTask()
|
||||
{
|
||||
photoChooserTask.Completed += cameraTask_Completed;
|
||||
//photoChooserTask.PixelHeight = 100;
|
||||
//photoChooserTask.PixelWidth = 100;
|
||||
photoChooserTask.ShowCamera = true;
|
||||
photoChooserTask.Show();
|
||||
}
|
||||
|
||||
@@ -517,8 +718,10 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
// Seek back so we can create an image.
|
||||
e.ChosenPhoto.Seek(0, SeekOrigin.Begin);
|
||||
// Create an image from the stream.
|
||||
var imageSource = PictureDecoder.DecodeJpeg(e.ChosenPhoto);
|
||||
MyPicture = imageSource;
|
||||
//var imageSource = PictureDecoder.DecodeJpeg(e.ChosenPhoto);
|
||||
BitmapImage bi = new BitmapImage();
|
||||
bi.SetSource(e.ChosenPhoto);
|
||||
MyPicture = bi;// imageSource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,13 +787,20 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
|
||||
private void PublishLocationAction()
|
||||
{
|
||||
Friend myInfo = new Friend();
|
||||
myInfo.Id = Identification.GetDeviceId();
|
||||
myInfo.FriendName = MyName;
|
||||
myInfo.LastUpdated = DateTime.UtcNow;
|
||||
myInfo.LocationStr = string.Format("POINT({0} {1})", MapCenter.Latitude, MapCenter.Longitude);
|
||||
IsBusy = true;
|
||||
ServiceAgent.PublishLocation(myInfo, new EventHandler<PublishLocationEventArgs>(PublishLocationResult));
|
||||
if (GpsLocation != GeoCoordinate.Unknown)
|
||||
{
|
||||
Friend myInfo = new Friend();
|
||||
myInfo.Id = Identification.GetDeviceId();
|
||||
myInfo.FriendName = MyName;
|
||||
myInfo.LastUpdated = DateTime.UtcNow;
|
||||
myInfo.LocationStr = string.Format("POINT({0} {1})", GpsLocation.Latitude, GpsLocation.Longitude);
|
||||
IsBusy = true;
|
||||
ServiceAgent.PublishLocation(myInfo, new EventHandler<PublishLocationEventArgs>(PublishLocationResult));
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("GPS position not aquired yet!");
|
||||
}
|
||||
}
|
||||
|
||||
public void GetFriendsResult(object sender, FriendsListEventArgs args)
|
||||
@@ -710,12 +920,13 @@ namespace MyFriendsAround.WP7.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
////public override void Cleanup()
|
||||
////{
|
||||
//// // Clean up if needed
|
||||
public override void Cleanup()
|
||||
{
|
||||
// Clean up if needed
|
||||
|
||||
//// base.Cleanup();
|
||||
////}
|
||||
base.Cleanup();
|
||||
_gpsWatcher.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -160,6 +160,9 @@ namespace MyFriendsAround.WP7.Views
|
||||
//save
|
||||
IsolatedStorageHelper.SaveToLocalStorage("myphoto.jpg", "profiles", _imageBytes);
|
||||
//
|
||||
//BitmapImage bi = new BitmapImage();
|
||||
//stream.Seek(0, SeekOrigin.Begin);
|
||||
//bi.SetSource(stream);
|
||||
Container.Instance.Resolve<MainViewModel>("MainViewModel").MyPicture = wbm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
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:Core="clr-namespace:Microsoft.Phone.Controls.Maps.Core;assembly=Microsoft.Phone.Controls.Maps">
|
||||
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-->
|
||||
|
||||
@@ -44,13 +45,17 @@
|
||||
HorizontalAlignment="Left">
|
||||
<Image x:Name="imgFriend"
|
||||
Source="{Binding PinImageUrl, Mode=OneWay}"
|
||||
Margin="2, 2, 2, 24" Width="48" Height="48"
|
||||
Margin="2, 2, 2, 24"
|
||||
Width="48"
|
||||
Height="48"
|
||||
Stretch="Fill">
|
||||
</Image>
|
||||
<TextBlock HorizontalAlignment="Left"
|
||||
Text="{Binding PinUserName, Mode=OneWay}"
|
||||
Text="{Binding PinUserName, Mode=OneWay}"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="1" Width="48" Height="24" />
|
||||
Margin="1"
|
||||
Width="48"
|
||||
Height="24" />
|
||||
</Grid>
|
||||
<Polygon Fill="{TemplateBinding Background}"
|
||||
Points="0,0 29,0 0,29"
|
||||
@@ -67,7 +72,7 @@
|
||||
<cmd:EventToCommand Command="{Binding MainLoadCommand}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
|
||||
<Grid x:Name="LayoutRoot"
|
||||
Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -85,15 +90,15 @@
|
||||
</DataTemplate>
|
||||
<my:MapItemsControl x:Name="GroupAPins"
|
||||
ItemTemplate="{StaticResource LogoTemplate}"
|
||||
ItemsSource="{Binding PushPins}"
|
||||
>
|
||||
ItemsSource="{Binding PushPins}">
|
||||
</my:MapItemsControl>
|
||||
</Grid.Resources>
|
||||
|
||||
|
||||
<!--ContentPanel - place additional content here-->
|
||||
<!--ContentPanel - place additional content here-->
|
||||
<Grid x:Name="ContentGrid"
|
||||
Grid.Row="0" VerticalAlignment="Stretch"
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Stretch"
|
||||
Grid.RowSpan="2"
|
||||
Margin="0">
|
||||
|
||||
@@ -111,72 +116,100 @@
|
||||
|
||||
<my:Map x:Name="map"
|
||||
CredentialsProvider="AkCiPfQt9YM0cCkZlltdR3mnFQRkV41l4f-eXFmf3qcBBhBC-EkvD8MuazOkMnE_"
|
||||
HorizontalAlignment="Stretch" ZoomBarVisibility="Visible"
|
||||
HorizontalAlignment="Stretch"
|
||||
ZoomBarVisibility="Visible"
|
||||
Margin="6,0,6,0"
|
||||
VerticalAlignment="Stretch"
|
||||
Center="{Binding Path=MapCenter, Mode=TwoWay}"
|
||||
ZoomLevel="{Binding Path=MapZoom, Mode=TwoWay}"
|
||||
AnimationLevel="Full"
|
||||
ViewChangeEnd="map_ViewChangeEnd"
|
||||
>
|
||||
ZoomLevel="{Binding Path=MapZoom, Mode=TwoWay}"
|
||||
AnimationLevel="Full"
|
||||
ViewChangeEnd="map_ViewChangeEnd">
|
||||
<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 ItemsSource="{Binding MyLocationPushPins}">
|
||||
<my:MapItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<my:Pushpin Location="{Binding Location}"
|
||||
Background="{StaticResource PhoneAccentBrush}"
|
||||
Template="{StaticResource PushpinControlTemplate1}" />
|
||||
</DataTemplate>
|
||||
</my:MapItemsControl.ItemTemplate>
|
||||
</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 HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Width="64"
|
||||
>
|
||||
<Rectangle RadiusX="10"
|
||||
RadiusY="10"
|
||||
Fill="Black"
|
||||
Opacity="0.3"
|
||||
Margin="0,0,-20,0"
|
||||
>
|
||||
</Rectangle>
|
||||
|
||||
|
||||
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Stretch">
|
||||
<Image Source="/icons/appbar.location.png"
|
||||
Margin="0"
|
||||
Width="64"
|
||||
Height="64"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Left"
|
||||
/>
|
||||
<Image Source="/icons/appbar.location.png"
|
||||
Margin="0"
|
||||
Width="64"
|
||||
Height="64"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<!--TitlePanel contains the name of the application and page title-->
|
||||
<Grid x:Name="TitlePanel"
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
Background="Black"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Stretch"
|
||||
Opacity="0.8">
|
||||
Grid.Row="0"
|
||||
Margin="0"
|
||||
Background="Black"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Stretch"
|
||||
Opacity="0.8">
|
||||
<TextBlock x:Name="ApplicationTitle"
|
||||
Margin="12, 12, 0, 0"
|
||||
Text="{Binding ApplicationTitle}"
|
||||
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" Opacity="1"
|
||||
Source="{Binding MyPicture, Mode=OneWay}" Margin="0" Stretch="Fill" >
|
||||
Opacity="1">
|
||||
<Image x:Name="imgMine"
|
||||
Opacity="1"
|
||||
Source="{Binding MyPicture, Mode=OneWay}"
|
||||
Margin="0"
|
||||
Stretch="Fill"
|
||||
>
|
||||
</Image>
|
||||
<Border Background="{StaticResource PhoneAccentBrush}"
|
||||
Width="80"
|
||||
Height="25"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
BorderThickness="0" Opacity="1">
|
||||
BorderThickness="0"
|
||||
Opacity="1">
|
||||
<TextBlock x:Name="txtMyName"
|
||||
Style="{StaticResource PhoneTextNormalStyle}"
|
||||
FontSize="16"
|
||||
@@ -184,7 +217,8 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2"
|
||||
Text="{Binding MyName, Mode=OneWay}" Opacity="1" />
|
||||
Text="{Binding MyName, Mode=OneWay}"
|
||||
Opacity="1" />
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -208,7 +242,8 @@
|
||||
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}}" />
|
||||
Text="{Binding AppBarTextRefresh}"
|
||||
IsEnabled="{Binding Path=IsBusy, Converter={StaticResource InvertValueConverter1}}" />
|
||||
<Preview:BindableApplicationBarIconButton Command="{Binding PublishLocationCommand}"
|
||||
IconUri="/icons/appbar.publish.png"
|
||||
Text="{Binding AppBarTextPublish}" />
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
VerticalAlignment="Stretch"
|
||||
Stretch="Uniform"
|
||||
Margin="1"
|
||||
Source="{Binding MyPicture}"></Image>
|
||||
Source="{Binding MyPicture, Mode=TwoWay}"></Image>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<cmd:EventToCommand
|
||||
|
||||
Reference in New Issue
Block a user