diff options
author | Vitaly Takmazov | 2014-12-23 01:29:17 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2014-12-23 01:29:17 +0300 |
commit | cb08471c057e78d278891f08d03bc4aa41fe4d0d (patch) | |
tree | 3bb69a5de15592993efacfe9b347189b81592ad5 /Juick/Classes/MyUriMapper.cs | |
parent | 2fe738b15dd6fb2fd459f260c35fa87c3ae99814 (diff) |
Fast resume
Diffstat (limited to 'Juick/Classes/MyUriMapper.cs')
-rw-r--r-- | Juick/Classes/MyUriMapper.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Juick/Classes/MyUriMapper.cs b/Juick/Classes/MyUriMapper.cs new file mode 100644 index 0000000..4f757a5 --- /dev/null +++ b/Juick/Classes/MyUriMapper.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Navigation; + +namespace Juick.Classes +{ + public class MyUriMapper : UriMapperBase + { + public override Uri MapUri(Uri uri) + { + string tempUri = uri.OriginalString; + string mappedUri; + + // Launch from the photo share picker. + // Incoming URI example: /MainPage.xaml?Action=ShareContent&FileId=%7BA3D54E2D-7977-4E2B-B92D-3EB126E5D168%7D + if ((tempUri.Contains("ShareContent")) && (tempUri.Contains("FileId"))) + { + mappedUri = tempUri.Replace("MainPage", "NewPostView"); + return new Uri(mappedUri, UriKind.Relative); + } + + if (!App.AppContext.Account.IsAuthenticated) + { + mappedUri = tempUri.Replace("MainPage", "LoginView"); + return new Uri(mappedUri, UriKind.Relative); + } + + // Otherwise perform normal launch. + return uri; + } + } +} |