diff --git a/main/MyFriendsAround.WP7/App.xaml b/main/MyFriendsAround.WP7/App.xaml index fea105e..86e6d0e 100644 --- a/main/MyFriendsAround.WP7/App.xaml +++ b/main/MyFriendsAround.WP7/App.xaml @@ -6,12 +6,16 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - xmlns:vm="clr-namespace:MyFriendsAround.WP7.ViewModel"> + xmlns:vm="clr-namespace:MyFriendsAround.WP7.ViewModel" + xmlns:my="clr-namespace:Coding4Fun.Phone.Controls.Converters;assembly=Coding4Fun.Phone.Controls" + xmlns:my1="clr-namespace:Microsoft.Silverlight.Testing.Client;assembly=Microsoft.Silverlight.Testing"> + + diff --git a/main/MyFriendsAround.WP7/App.xaml.cs b/main/MyFriendsAround.WP7/App.xaml.cs index 97e1652..13a2704 100644 --- a/main/MyFriendsAround.WP7/App.xaml.cs +++ b/main/MyFriendsAround.WP7/App.xaml.cs @@ -14,6 +14,7 @@ using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using MyFriendsAround.WP7.ViewModel; using MyFriendsAround.WP7.Utils; +using GalaSoft.MvvmLight.Threading; namespace MyFriendsAround.WP7 @@ -45,6 +46,7 @@ namespace MyFriendsAround.WP7 // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { + DispatcherHelper.Initialize(); LoadModel(); } @@ -52,6 +54,7 @@ namespace MyFriendsAround.WP7 // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { + DispatcherHelper.Initialize(); LoadModel(); } @@ -75,6 +78,7 @@ namespace MyFriendsAround.WP7 private void LoadModel() { + // MainViewModel mainModel = this.RetrieveFromIsolatedStorage(); if (mainModel != null) { diff --git a/main/MyFriendsAround.WP7/MyFriendsAround.WP7.csproj b/main/MyFriendsAround.WP7/MyFriendsAround.WP7.csproj index aff3d71..89621a2 100644 --- a/main/MyFriendsAround.WP7/MyFriendsAround.WP7.csproj +++ b/main/MyFriendsAround.WP7/MyFriendsAround.WP7.csproj @@ -63,6 +63,12 @@ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + + ..\packages\Coding4Fun.Phone.Controls.Complete.1.2\lib\Coding4Fun.Phone.Controls.dll + + + ..\packages\Coding4Fun.Phone.Controls.Complete.1.2\lib\Coding4Fun.Phone.Controls.Toolkit.dll + False C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WP7\GalaSoft.MvvmLight.WP7.dll @@ -79,7 +85,7 @@ - ..\packages\SilverlightToolkitWP.4.2011.2.1\lib\sl4\Microsoft.Phone.Controls.Toolkit.dll + ..\packages\Coding4Fun.Phone.Controls.Complete.1.2\lib\Microsoft.Phone.Controls.Toolkit.dll ..\Libs\SL3_UTF_May\Microsoft.Silverlight.Testing.dll @@ -171,6 +177,7 @@ Always + PreserveNewest diff --git a/main/MyFriendsAround.WP7/ViewModel/MainViewModel.cs b/main/MyFriendsAround.WP7/ViewModel/MainViewModel.cs index 01298c6..add22c6 100644 --- a/main/MyFriendsAround.WP7/ViewModel/MainViewModel.cs +++ b/main/MyFriendsAround.WP7/ViewModel/MainViewModel.cs @@ -56,11 +56,12 @@ namespace MyFriendsAround.WP7.ViewModel /// public MainViewModel() { - MyName = "Guest"; + // PublishLocationCommand = new RelayCommand(() => PublishLocationAction()); DisplayAboutCommand = new RelayCommand(() => DisplayAbout()); InputBoxCommand = new RelayCommand(() => InputBox()); NavigateToAboutCommand = new RelayCommand(() => NavigateToAbout()); + RefreshFriendsCommand = new RelayCommand(() => RefreshFriends()); if (IsInDesignMode) { @@ -69,12 +70,16 @@ namespace MyFriendsAround.WP7.ViewModel else { // Code runs "for real" - IsBusy = true; - ServiceAgent.GetFriends(this.GetFriendsResult); } } + private void RefreshFriends() + { + IsBusy = true; + ServiceAgent.GetFriends(this.GetFriendsResult); + } + private void NavigateToAbout() { // @@ -163,12 +168,8 @@ namespace MyFriendsAround.WP7.ViewModel public ICommand PublishLocationCommand { get; set; } public ICommand DisplayAboutCommand { get; set; } public ICommand InputBoxCommand { get; set; } - - public ICommand NavigateToAboutCommand - { - get; - private set; - } + public ICommand NavigateToAboutCommand { get; set; } + public ICommand RefreshFriendsCommand { get; set; } /// @@ -206,6 +207,11 @@ namespace MyFriendsAround.WP7.ViewModel get { return "Publish"; } } + public string AppBarTextRefresh + { + get { return "Refresh"; } + } + ////public override void Cleanup() ////{ //// // Clean up if needed diff --git a/main/MyFriendsAround.WP7/Views/MainPage.xaml b/main/MyFriendsAround.WP7/Views/MainPage.xaml index 5b6dbb6..ce18653 100644 --- a/main/MyFriendsAround.WP7/Views/MainPage.xaml +++ b/main/MyFriendsAround.WP7/Views/MainPage.xaml @@ -19,7 +19,8 @@ shell:SystemTray.IsVisible="True" 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:Preview="clr-namespace:Phone7.Fx.Preview;assembly=Phone7.Fx.Preview" + xmlns:binding="clr-namespace:Coding4Fun.Phone.Controls.Binding;assembly=Coding4Fun.Phone.Controls"> @@ -37,6 +38,12 @@ + + + + + + @@ -80,7 +87,8 @@ Name="txtMyName" Text="{Binding Path=MyName, Mode=TwoWay}" VerticalAlignment="Bottom" - Width="468" /> + Width="468" + binding:TextBoxBinding.UpdateSourceOnChange="True" /> + diff --git a/main/MyFriendsAround.WP7/Views/MainPage.xaml.cs b/main/MyFriendsAround.WP7/Views/MainPage.xaml.cs index 64b0306..8a6d89a 100644 --- a/main/MyFriendsAround.WP7/Views/MainPage.xaml.cs +++ b/main/MyFriendsAround.WP7/Views/MainPage.xaml.cs @@ -12,8 +12,6 @@ namespace MyFriendsAround.WP7 // Constructor public MainPage() { - - DispatcherHelper.Initialize(); InitializeComponent(); Messenger.Default.Register( diff --git a/main/MyFriendsAround.WP7/icons/appbar.sync.rest.png b/main/MyFriendsAround.WP7/icons/appbar.sync.rest.png new file mode 100644 index 0000000..faf303d Binary files /dev/null and b/main/MyFriendsAround.WP7/icons/appbar.sync.rest.png differ diff --git a/main/MyFriendsAround.WP7/packages.config b/main/MyFriendsAround.WP7/packages.config index 2be0aa0..acf8d2c 100644 --- a/main/MyFriendsAround.WP7/packages.config +++ b/main/MyFriendsAround.WP7/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/Coding4Fun.Phone.Controls.Complete.1.2.nupkg b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/Coding4Fun.Phone.Controls.Complete.1.2.nupkg new file mode 100644 index 0000000..faa932b Binary files /dev/null and b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/Coding4Fun.Phone.Controls.Complete.1.2.nupkg differ diff --git a/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.Toolkit.dll b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.Toolkit.dll new file mode 100644 index 0000000..e3dabbc Binary files /dev/null and b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.Toolkit.dll differ diff --git a/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.dll b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.dll new file mode 100644 index 0000000..b179848 Binary files /dev/null and b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Coding4Fun.Phone.Controls.dll differ diff --git a/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Microsoft.Phone.Controls.Toolkit.dll b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Microsoft.Phone.Controls.Toolkit.dll new file mode 100644 index 0000000..7ac919b Binary files /dev/null and b/main/packages/Coding4Fun.Phone.Controls.Complete.1.2/lib/Microsoft.Phone.Controls.Toolkit.dll differ