Skip to content
Browse files

Minor fixes on the Authorization page

Added the missing default Style tag on the AuthorizationPage
Improved the error handling of the AuthorizationViewModel authentication
code handling
  • Loading branch information...
1 parent 79adfee commit 16926ccd67fc6c19853e16f91a8cb45a69e77a32 @PedroLamas committed
View
4 PedroLamas.WP7.GDrive/View/AuthorizationPage.xaml
@@ -14,8 +14,8 @@
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
- shell:SystemTray.Opacity="0"
- DataContext="{Binding Authorization, Source={StaticResource Locator}}">
+ DataContext="{Binding Authorization, Source={StaticResource Locator}}"
+ Style="{StaticResource PhoneApplicationPageStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
View
17 PedroLamas.WP7.GDrive/ViewModel/AuthorizationViewModel.cs
@@ -92,18 +92,25 @@ public AuthorizationViewModel(IMainModel mainModel, IGoogleAuthService googleAut
_systemTrayService.SetProgressIndicator("");
}
- if (e.Uri.Host != "localhost")
+ if (e.Uri == null || e.Uri.Host != "localhost")
return;
ShowBrowser = false;
WebBrowserSourceUri = new Uri("https://accounts.google.com/Logout");
- var queryValues = e.Uri.Query.TrimStart('?').Split('&')
- .Select(x => x.Split('='))
- .ToDictionary(x => x[0], x => x.Length > 0 ? Uri.UnescapeDataString(x[1]) : null);
+ try
+ {
+ var queryValues = e.Uri.Query.TrimStart('?').Split('&')
+ .Select(x => x.Split('='))
+ .ToDictionary(x => x[0], x => x.Length > 0 ? Uri.UnescapeDataString(x[1]) : null);
- ExchangeAuthorizationCode(queryValues["code"]);
+ ExchangeAuthorizationCode(queryValues["code"]);
+ }
+ catch
+ {
+ _messageBoxService.Show("Unable to exchange the authentication code!", "Error");
+ }
});
WebBrowserNavigatedCommand = new RelayCommand<NavigationEventArgs>(e =>

0 comments on commit 16926cc

Please sign in to comment.
Something went wrong with that request. Please try again.